0

I'm trying to automate the APIs which is implemented as part of portal UI solution. Here Authorization happens on role level. In UI, role is decided by selecting one of the role's radio button and click on login. And I can get the bearer token for the role from network tab manually. If I try to automate the API's, Bearer token is required. I'm using http protocol to automate. Problem is my JWT bearer token is valid only for 3hrs. This eventually force me to take new bearer token during every execution as I will be integrating it with CI. How to take Bearer token before hitting the API's using http protocol ?

  • I see few issues here. JWT token should tell what role user belongs to, not like user selects the role and request for token for specific role. Token based auth are based on "access-token", "refresh-token". Refresh token is used to request new access-token. Validity of "refresh-token" is generally kept longer usually 10-15 days or even 30 days. When you make api call and find that access token is expired then use refresh token to get new access token and use that in API request. – NarendraSoni Oct 02 '19 at 10:31
  • I got the solution. I developed a specific service to get the Bearer token with required Inputs – Keerthivasan S Oct 16 '19 at 13:44

0 Answers0