ADFS 3.0 using OAuth and Persistent Refresh Tokens

£可爱£侵袭症+ 提交于 2021-02-08 07:56:36

问题


Question 1

We are currently using ADFS and OAuth (using Windows Server 2012 R2 with ADFS 3.0). Our test applications (both WPF and mobile apps) can successfully authenticate and get an Access Token and a Refresh Token. We can after that continue to use the Access Token until it expires and after that use the Refresh Token to get a new Access Token. So far so good, but the problem is when the Refresh Token expires, we need to force the user to enter their credentials again. Our aim is to have the user to only enter their credentials once and then use a short lifetime for Access Token and a Persistent lifetime (or really really long) for Refresh Tokens.

According to some blog posts when using a Refresh Token you should get a new Access Token and sometimes also a new Refresh Token, but in our case we never get a new refresh token, so that one eventually expires.

Is this even possible using ADFS 3.0 and OAuth to have a persistent Refresh Token? or get new refresh tokens from time to time so that the user doesn't have to enter their credentials again? or is it possible to have a really long lifetime for refresh tokens.

Question 2

There is also a lot of different properties you can set in ADFS that we are not sure of

  • TokenLifetime - This is the access token lifetime? what is maximum value?
  • SsoTokenLifetime - This is the refresh token lifetime? what is maximum value?
  • PersistentSsoLifetimeMins - what is this?
  • PersistentSsoEnabled - I guess should be set to true to have refresh tokens working

回答1:


This post describes a semi-official answer. Here's an example of setting the required values -

Set-AdfsRelyingPartyTrust -TargetName "RPT Name" -IssueOAuthRefreshTokensTo AllDevices
Set-AdfsRelyingPartyTrust -TargetName "RPT Name" -TokenLifetime 10
Set-AdfsProperties -SSOLifetime 480

For the specified RPT, this would issue access tokens with a lifetime of 10 minutes and refresh tokens to all clients with a lifetime of 8 hours.




回答2:


The only semi-official guidance I have been able to dig up is this slideset:

http://www.oxfordcomputergroup.com/wp-content/uploads/Access-the-future-Alex-Simons.pdf

which states:

Configurable Refresh token support Lifetime: workplace joined device 7 days (PSSO lifetime) Non-workplace joined device max. 24 hours.

Persistent refresh token support in ADFS sure would be nice, but it seems they see the feature mostly as a tie-in to their mobile device management offerings.



来源:https://stackoverflow.com/questions/22330004/adfs-3-0-using-oauth-and-persistent-refresh-tokens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!