sourcefuse / loopback4-starter

Loopback 4 starter application. Multi-tenant architecture supported. Authentication, Authorization, Soft deletes, environment vars, Audit logs, included.
MIT License
158 stars 59 forks source link

Can't use Oauth2 resource owner login way #58

Open filol opened 4 years ago

filol commented 4 years ago

Describe the bug Can't connect via auth/login-token

I have add my user's id in user_id column of auth_clients table (and save it) but i still get this error :

{
    "error": {
        "statusCode": 401,
        "name": "UnauthorizedError",
        "message": "Bearer realm=\"Users\""
    }
}

The request body: (with the same body i can get the code with

{
    "client_id": "webapp",
    "client_secret": "saqw21!@",
    "username": "super_admin",
    "password": "test123!@#"
}
mayank-SFIN571 commented 4 years ago

Hi @filol , This error denotes that 'Bearer' is not attached to the token (which is being sent in the headers in the key 'Authorization'). But for this particular api, this should not be the case. This api does not expect any token. Can you share the changes that you might have made in the api?

filol commented 4 years ago

@mayank-SFIN571 i have just update deps (why they are so out of date ?) and activate the db migration tool of lb (the native one)

samarpan-b commented 3 years ago

@mayank-SFIN571 can u please check which dependency is not up to date ?

samarpan-b commented 3 years ago

https://github.com/sourcefuse/loopback4-starter/pull/65 might resolve this issue. @filol can you please check ?

akshatdubeysf commented 3 years ago

@filol can you please confirm if it is okay to close this issue?