cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
317
Views
0
Helpful
1
Replies

How to use webex.authorization.requestAccessTokenFromJwt({jwt})

Raffaele Lagana
Cisco Employee
Cisco Employee

Hi, I'm new to Webex JS SDK and Javascript, and I want to log the access token to console after getting it by calling webex.authorization.requestAccessTokenFromJwt({jwt}). How does this work?

1 Accepted Solution

Raffaele Lagana
Cisco Employee
Cisco Employee

That function is simply making a POST request to 

https://webexapis.com/v1/jwt/login with whatever the jwt value is. It would be in an Authorization header as a bearer token.

We have a great sample that uses exactly this method to authenticate the JWT, you can check it out here: https://webexsamples.github.io/browser-sdk-samples/browser-auth-jwt/ . Code for that sample is found here: https://github.com/WebexSamples/browser-sdk-samples/tree/main/browser-auth-jwt (the app.js file contains this function)

View solution in original post

1 Reply 1

Raffaele Lagana
Cisco Employee
Cisco Employee

That function is simply making a POST request to 

https://webexapis.com/v1/jwt/login with whatever the jwt value is. It would be in an Authorization header as a bearer token.

We have a great sample that uses exactly this method to authenticate the JWT, you can check it out here: https://webexsamples.github.io/browser-sdk-samples/browser-auth-jwt/ . Code for that sample is found here: https://github.com/WebexSamples/browser-sdk-samples/tree/main/browser-auth-jwt (the app.js file contains this function)