Forum Discussion
fuenteso
Leader
Hi rajpi,
Not exactly. I don't remember the details, but I think I was trying to get the token to do some editing actions on community, but I was using a component and I belive that was the issue. I was told the call has to come from a back-end evironment (can't use an endpoint either).
So I ended up building the component in a way where I have to manually log in to the community before using it.
rajpi
8 years agoAdept
Hi fuenteso
I got the Oauth issue resolved, error was with appropriate permissions on the account and also some extra characters that went in the client id. Here is how I solved this issue, this may be useful to someone.
- Log into community and then run the following call in your browser (be sure to add the URL encoded client ID and you can leave the redirect uri as is):
- Get Authorization Code:
GET
https://<communityname_withouthttps>/auth/oauth2/authorize?client_id=<urlencodedclient_id>&response_type=code&redirect_uri=<exact_callbackuri_with_https_nothingextra> - You should receive an authorization code that can be leveraged to obtain the access & refresh tokens
- https://api.lithium.com/auth/v1/accessToken
Header:
Content-Type : application/json
client_id : <client_id_without_encoding> Body ==> JSON(application/json)
{"client_id":"<client_id>",
}
"client_secret":"<client_secret>",
"grant_type":"authorization_code",
"redirect_uri":"<redirect_url>",
"code":"<AuthCode>"
Thanks
Raj
Related Content
- 6 years ago
- 2 years ago