I tried to automate using karate framework following steps which I did in postman. How I tried in Postman:
- On Authorization tab select OAuth 2.0
- Select Header Prefix Bearer
- Grant-Type is "Implicit"
- I put Callback URL
- I put Auth URL
- I put Client ID
- Select "Client Authentication" as Send as Basic Auth Header.
I used following code in order to get Access token Background:
* url 'Auth URL'
Scenario: Verify the user details using OAuth2 Implicit grant type
* form field callbackurl = 'callbackurl'
* form field grant_type = 'implicit'
* form field client_id = 'client id'
* form field username = 'username'
* form field password = 'password'
* method post
* status 200
* print response
* def accessToken = response.access_token
* path 'resource'
* header Authorization = 'Bearer ' + accessToken
# * param access_token = accessToken
* method post
* status 200
In output I got // UserpoolId is not available on frontend for springboard. We do not use userPoolId // anyway other than put in context data. var userPoolId = ""; var clientId = getUrlParameter("client_id");
I do not know where I am wrong. Please provide your help. Thanks!