Oauth2 Resr Api authentication in laraver

Posted in CategoryLaravel
  • M
    Mahesh Kumar 1 year ago

    Actually i want to implement oauth2 rest Api authentication in Laravel, 

    I have install a passport library and implement all the process.

    i am sending an access token at the header of the request.

    but I have to call the login api again and agin to generate a access token, and i this process there 

    so many data store into the oauth_access_tokens.

    if i run any api i have to generate the access toke using login api and then send with the header.

    and it store into the  oauth_access_tokens table.

    so bulk data issue problem occur.

    Is there any solution to generete access token without callling the login api.


    I want to call the access token using the client id and client secrete.

    and then send this access token with the header. and wanto to run a detail api .

    Please suggest me any solution.

    I am new in the Laravel.


  • H
    Hardik Savani 1 year ago

    You can see here for create REST API example : https://itsolutionstuff.com/post/php-laravel-56-rest-api-with-passport-tutorialexample.html 

    You can simply get token by client id and client secret like this way:

    you can see on above image...

  • M
    Mahesh Kumar 1 year ago

    I can access the token using the above but my issue is that, if i am calling api many time like 


    Then so many entry enter into the  oauth_access_tokens table. So bulk of data entry issue into oauth_access_tokens.


  • M
    Mahesh Kumar 1 year ago

    Please provide me solution bulk of entry in  oauth_access_tokens table for same user ?


  • M
    Mahesh Kumar 1 year ago

    How to update the Access token into the Oauth_access_tokens table when calling the a request for same client again and again?

    Please help me

Please login or register to leave a response.

* You May Also Like Bellow Issue to check *