Will Oauth2 Authentication access token for Office 365 expire?

Answered

Comments

6 comments

  • Official comment
    Avatar
    Varun Agasthya

    Hi Michael,

    Client secrets for SharePoint Add-ins that are registered by using the AppRegNew.aspx page expire after one year. The blog : http://www.agilepointnxblog.com/create-non-expiring-access-tokens-for-office-365/ is updated with how to replace an expiring client secret and also how to register app with longer expiration time

    Thanks,

    Nithya V

    Comment actions Permalink
  • Avatar
    Michael M.

    Thank you Nithya. One more question, is it really possible to create client secret with 10 years expiration time? 

    0
    Comment actions Permalink
  • Avatar
    Varun Agasthya

    Hi Michael,

    Yes, it is possible to create client secret with 10 years expiration time, please follow the steps in the blog to create client secret with longer expiration time.

     

    Thanks,

    Nithya V

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    But the article from Microsoft, https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/replace-an-expiring-client-secret-in-a-sharepoint-add-in, has a note saying that:

    By default, the add-in secret lasts one year. You can set this to a shorter or longer (up to 3 years maximum) by using the -EndDate parameter on the three calls of the New-MsolServicePrincipalCredential cmdlet. The value of the parameter must be a DateTime object set to no longer than 3 years from DateTime.Now.

    So the 3 years maximum doesn't apply to the client secret used by AgilePoint Access Token?

    0
    Comment actions Permalink
  • Avatar
    Varun Agasthya

    Hi Michael,

    We have tried to set client secret expiration for 10 years following the steps from the blog and in the output file it shows that expiration is set for 10 years. Please find the screen captures below.

     

    Thanks,

    Nithya V

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    That's good news. Thank you Nithya.

    I will try it out.

    0
    Comment actions Permalink

Please sign in to leave a comment.