Is there a way to implement PAT tokens for my B2B application?

Drew 21 Reputation points
2022-05-26T15:11:18.44+00:00

I really like the PAT tokens in Azure Dev Ops, is there an equivalent to that I can use for my own B2B application with Microsoft Identity? If not is this something on the roadmap? I couldn't find any way to generate a token that lives for more than 90 days.
Thanks!

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2022-05-31T19:34:19.437+00:00

    Hello @Drew , Azure AD does not support long lived tokens. Refresh tokens have a default value of 90 days, 24 hours if they are issued to an SPA. You can however create your own PAT implementation using application (service principal) authentication. Keep in mind this involves high level permissions so be careful with the operations allowed. Basically, your (coded) application would generate, accept and manage (store, refresh, revoke, etc.) lifetime for PAT tokens for your B2B users. All operations on their behalf would be done using application permissions in tandem with MS Graph. Optionally you might try Conditional Access for workload identities (in preview) to secure access for server-to-server scenarios like the aforementioned.

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful