none
Web API Identity Server 3: Set different Refresh Token Expiration for a specific user

    Pertanyaan

  • Hi All,

    I have the following setup:

    Client: AngularJS Web App

    Server: ASP.NET Web API

    In the server I use the IdentityFramework3 to authenticate users on my AngularJS Client that has the (oidc-token-manager) configured.

    Currently I'm setting the AbsoluteRefreshTokenLifetime to 48 hours for my Client MyAngularJsApp like so:


    new Client
    {
    	Enabled = true,
    	ClientId = MyAngularJsApp.Id,
    	ClientUri = MyAngularJsApp.Uri,
    	ClientName = MyAngularJsApp.Name,
    	Flow = Flows.Implicit,
    	AllowAccessToAllScopes = true,
    	IdentityTokenLifetime = 300,
    	AccessTokenLifetime = 3600,
    	RefreshTokenExpiration = TokenExpiration.Absolute,
    	RefreshTokenUsage = TokenUsage.ReUse,
    	AbsoluteRefreshTokenLifetime = TimeSpan.FromDays(2).Seconds,
    	RequireConsent = false,
    	RedirectUris = new List<string>
    	{
    		MyAngularJsApp.Uri + "/assets/idSrv/callback.html",
    		MyAngularJsApp.Uri + "/assets/idSrv/silentrefreshframe.html"
    	},
    	PostLogoutRedirectUris = new List<string>
    	{
    		MyAngularJsApp.Uri + "/index.html"
    	}
    },

    There is one specific user that will log into my client that I want to set his Refresh Token to last 100 days so that the user does not have to Authenticate in 100 days

    AbsoluteRefreshTokenLifetime = TimeSpan.FromDays(100).Seconds,


                 How do I make it so that only this user has this refresh token lifetime?


    Rabu, 17 Oktober 2018 22.45

Semua Balasan

  • Hi MyDevMikeP,

    Thank you for posting here.

    Since your question is more related to Web, you could post a new thread in ASP.NET forum for suitable support.

    https://forums.asp.net/

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Kamis, 18 Oktober 2018 02.54