oAuth JWT Client is invalid

Trying to auth a user to get a jwtToken for api calls. I do not want to create a “Service accounts” for each user in the system.

POST /Litium/OAuth/token HTTP/1.1
Host: domain
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=user&client_secret=password

but I get an error all the time

{
“error”: “invalid_clientId”,
“error_description”: “Client is invalid”
}

Litium version: 7.*

Create a service account and a service user and use that one for all users.

I need one account for each user due to each request is tied to that users not a global user for all users.
And I dont realy want to user “Service account”. Create a Service account for 1000s of custumers and keep there password sync to the Service account will be a problem.

I will try this and get back to you.

Can you describe exactly what you are trying to do and give me the scenario so I can test?

If we want to create a Mobile app where the user can login and access its information.

So i just tried to login with a new user and there were no issues.
Did you try this from the Swagger?
Is this address suffix what you are using also?

http://lit7.localtest.me/HeadlessApi/CookieAuthentication/Login

I have not install HeadlessApi addon, will try that. But we would like to have a jwtToken and not work with cookies :slight_smile:

For your mobile-app you will create a service account. For each user that want to login you will use the password grant OAuth2 flow to let the application directly passing the user credential and returning the token for the user.

Example for the password grant flow can be found here https://www.oauth.com/oauth2-servers/access-tokens/password-grant/ but use the token url /Litium/OAuth/token instead of /oauth/token

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.