简体   繁体   中英

how to get access token via identityserver4 via method (not api)?

You can get a token by making a request for the token (as per example below).

But how do you get a (client credential) access token from within identityserver class (without requesting it via http POST web service api)? is there an identityserver4 method to use to obtain an access token?


http://docs.identityserver.io/en/release/endpoints/token.html

POST /connect/token

client_id=client1&
client_secret=secret&
grant_type=authorization_code&
code=hdh922&
redirect_uri=https://myapp.com/callback

Yes you can use the IssueJwtAsync or IssueClientJwtAsync methods from the IdentityServerTools class to do exactly that.

As per documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM