joaojosefilho/vuejsOidcClient

How to request Access Token after Authentication

Closed this issue · 3 comments

I have finished Authentication, then i want to get Access Token via https://xxxxx/connect/token

Use this method

In vue-js, I use 'Promise' to call the methods in sync mode

getAcessToken(){
    return new Promise((resolve, reject) => {
      mgr.getUser().then(function (user) {
          return resolve(user.access_token)        
      }).catch(function (err) {
        console.log(err)
        return reject(err)
      });
    })
  }

In this link, I create examples of methods using the oidc-client library:
https://github.com/joaojosefilho/vuejsOidcClient/blob/master/src/services/SecurityService.js

oicd-client Documentation for more details:
https://github.com/IdentityModel/oidc-client-js/wiki

Did you solve your problem?

I will close this issui. You can open this issui if you have more questions.