Generating guest tokens

Posted 3 months ago by winner1

I'm using passport on my project

I want to make some specific routes accessible for all of my API users without using username and password to take an access token

the reason is that some routes like reading a table records should be usable for all of my android application users to load posts and ... without registering(tell me if this is not the best way to make that possible!)

lets suppose user can use this endpoint to obtain a guest access token:

mysite.com/api/oauth/authGuest

and result should be something like:

{"token_type":"Bearer","expires_in":863999,
"access_token":"token",
"refresh_token":"refToken"}

after that, user can access guest-allowed routes

do you have any idea that which method should I use?

I also checked this question but I'm not so familiar to jwt:

https://stackoverflow.com/questions/42487333/laravel-passport-guest-token

thanks in advance

Please sign in or create an account to participate in this conversation.