Hi all
My understanding in how to use the auth button on the swagger api is to use the login2 api to obtain the token to be included in the header of authorized (locked) apis.
My question is: How to obtain the key token using a third party (Google in my case) identity provider?. In that case, there is no password to be provided to login2 api and, therefore, I'm not able to obtain the security token.
Any help would be highly appreciated.
Cesc
Swagger Api and autorization using third part identity provider
Re: Swagger Api and autorization using third part identity provider
Anyone? ESP Rainmaker guys?
Re: Swagger Api and autorization using third part identity provider
For third party providers like Google, RainMaker leverages standard OAuth.
There are two steps involved in this:
1. Authorise:
Paste the below URL in browser and signin with your Google credentials. You will be redirected to redirect_uri and will receive a code as its query parameter.
https://3pauth.rainmaker.espressif.com/ ... lcome.html
2. Token:
Call the below token API with the code.
You should get an accesstoken and refreshtoken in response. Done!
Subsequently, you can use the refreshtoken to extend session using the login2 API.
Ps. We are working on adding these details to the swagger document.
Manali
There are two steps involved in this:
1. Authorise:
Paste the below URL in browser and signin with your Google credentials. You will be redirected to redirect_uri and will receive a code as its query parameter.
https://3pauth.rainmaker.espressif.com/ ... lcome.html
2. Token:
Call the below token API with the code.
Code: Select all
curl --location 'https://3pauth.rainmaker.espressif.com/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=1h7ujqjs8140n17v0ahb4n51m2' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=<code>' \
--data-urlencode 'redirect_uri=https://rainmaker-login-ui.s3.amazonaws.com/welcome.html'
Subsequently, you can use the refreshtoken to extend session using the login2 API.
Ps. We are working on adding these details to the swagger document.
Manali
Re: Swagger Api and autorization using third part identity provider
Many Thanks Manali, it works!
Who is online
Users browsing this forum: No registered users and 8 guests