I am working on project which has separate model for users — AppModelsCustomer. And also it has own authorisation fields — Email and cust_password. And also password is hashed by password_hash function. In my config/auth.php in providers section I set up my custom model: So I am trying to implement Laravel Gr…
Tag: laravel-passport
How to implement authentication & authorization between microservices & API Gateway using Laravel
I’m trying to implement authentication & authorization of users between my microservices and API Gateway.What I have now: API Gateway which can request to any microservice. User microservice – where I’m storing all users. laravel/passport implemented to authenticate user in this microser…
Bad hostname provided
Passport Version: ^10.1 Laravel Version: 8.77.1 PHP Version: 8.0.9 Database Driver & Version: mysql 8.0.27 I can not get access token. when I call it manual by curl it get this response. this host name is generate inside the docker container I’m test 192.168.224.6 ip of docker container but it also …
Laravel api route that grabs Auth::user() when Authorization is sent, but doesn’t hit 401 whenever you don’t
So right now I’m using Laravel’s default auth for api routes by doing this: The only thing with this is that it will throw a 401 if a non logged in user hits that page. What I’m wondering is if there’s a way to have a route that will login the user if a token is sent, but if not,
Safe location to write oauth key files in laravel
I am deploying my laravel application to AWS Elastic Beanstalk and I’m encountering the problem of persisting the oauth keys for laravel passport. I went through this and this. While the S3 option sounds reasonable, I still wanted a more secure way and wanted to checkout secret manager from AWS. Since l…
Laravel Passport callback route returns null
I am learning Laravel Passport and developing an OAuth2 server. After creating a client I made the following call to get the authorization code The call works as expected and I got the authorization code, however when redirecting to the callback route which is defined like so It didn’t work, the respons…
How to create and secure multi-auth api gurds using laravel 8 passport?
I’m building an API for android app which requires 2 types of authentication using Laravel 8. Users Auth and Teachers Auth. The problem that I have is that tokens which are created for users can be …
Laravel: Authenticate an Authenticatable Model statelessly
I need help. Current situation, I have a Company model. That company model refers to a Client Credentials grant OAuth Client (passport). I managed to make a middleware that resolves the current Company from request via the passed bearer token of the API request. The problem: I want to set that Company instanc…
Unable to locate factory for [LaravelPassportClient]
I have a laravel app with passport installed to manage api auth. I’m trying to write some tests but I’m unable to create a Client as per the docs on laravel. I’ve googled similar SO answers but they …
What’s the problem of using Password Grant Tokens for Nuxt SPA
I want to develop a Nuxt SPA with Laravel as backend. Read the Passport document and now confused about the following paragraph because I don’t want to redirect the user to backend login page: …