Forum Discussion
Hi,
I am able to get the authentication code now.
URL I hit from browser (GET call) :-
http://comity.stage.lithium.com/auth/oauth2/authorize?client_id=[url encoded client id]&response_type=code&redirect_uri=comity.stage.lithium.com
I got redirected to another URL, which contains the authentication code :-
http://comity.stage.lithium.com/t5/oauth/comity.stage.lithium.com?code=[url encoded authentication code]&user-id=15&tenant-id=comity
I am not getting expected response for next step.
Step 2 POST /accessToken
poster call :
URL : http://comity.stage.lithium.com/auth/v1/accessToken
example request -
LJdishd:~ joan.doe$ curl -X POST -H "Content-Type: application/json" -H
"client-id: Fblkh30GinF48502kEsk4FmGslkjdfjasdj=" -d '{"client_id" :"Fblkh30GinF48502kEsk4FmGslkjdfjasdj=",
"client_secret" :"FKDDASDK309slkdfaDkdlkjie92=","grant_type" : "authorization_code",
"redirect_uri" :"http://redirect.example_community.com/getaccessToken",
"code":"i7liaoFaOjG6yDKN4tQYXrhewKog3k4ryYGWLS6hbrI="}' "http://comity.stage.lithium.com/auth/v1/accessToken"
expected response
{
"response": {
"status": "success",
"message": "OK",
"http_code": 200,
"data": {
"access_token": "o5IV0yIiNDj/5lNJ6doJh08LX6SsDwtkDXDVmhGvRtI=",
"expires_in": 86400,
"lithium_user_id": "2d8c95ed-21dc-4ba6-ab9f-d3eff9c928ce",
"refresh_token": "XAAWIWKr38W33SlqYooR9OEJW0um9DoyB/o843rdIxk=",
"token_type": "bearer"
}
}
}
actual response I am getting is HTML of my community home page.
Am I missing anything? Has anyone faced the same issue?
Any pointer are welcome.
Thanks,
Vaishnavi
Hi Vaishnavi,
I am far from being an expert on the area, but I think your URL needs to be: https://api.stage.lithium.com/auth/v1/accessToken
Related Content
- 6 years ago
- 2 years ago