Will Oauth2 Authentication access token for Office 365 expire?

已回答

评论

6 条评论

  • 正式评论
    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

    评论操作 固定链接
  • Avatar
    Michael M.

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

    0
    评论操作 固定链接
  • 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
    评论操作 固定链接
  • 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
    评论操作 固定链接
  • 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
    评论操作 固定链接
  • Avatar
    Michael M.

    That's good news. Thank you Nithya.

    I will try it out.

    0
    评论操作 固定链接

请先登录再写评论。