I was struggling to get refresh token along with the access token with user credential(username and password) while accessing the IdentityServer 4.Finally I could generate the successful response as a result of my hard work. If you need refresh token from the identityserver 4 you must set the below configurations to the Memory clients which are using in the application.
I know some of you have the doubt about Memory clients😐 you are using memory client class in ConfigureServices method in the start up file as below screenshot.
in there you have to set AllowedScopes to IdentityServerConstants.StandardScopes.OfflineAccess as below.
Now you are finish with the configuration and you can try this using Postman(this could be your choice 😛) as below.
Once you have the refresh token in you hand it is very easy to get access token instead of set session timeout therefore user won't feel inconvenience while using the application and finally application will be a secure to trust.
you can set expiration to the token as your preferences.
Enjoy,
Happy coding 💪
I know some of you have the doubt about Memory clients😐 you are using memory client class in ConfigureServices method in the start up file as below screenshot.
in there you have to set AllowedScopes to IdentityServerConstants.StandardScopes.OfflineAccess as below.
Now you are finish with the configuration and you can try this using Postman(this could be your choice 😛) as below.
Once you have the refresh token in you hand it is very easy to get access token instead of set session timeout therefore user won't feel inconvenience while using the application and finally application will be a secure to trust.
you can set expiration to the token as your preferences.
Enjoy,
Happy coding 💪
Informative article. Keep writing :)
ReplyDeleteHi, very usefull article. it is very good and simple ... I am new with this technology can you please guide me..Thanks in advance
ReplyDeletevery useful
ReplyDeletekeep it up
Great article, I was looking for such article. thanks you very much
ReplyDeletevery useful,Thanks in advance
ReplyDeleteInteresting Read. Will be useful in the future
ReplyDelete