Forum Discussion

Moritz_Second's avatar
Moritz_Second
Copper Contributor
Oct 23, 2023

Extension Authentication at external Service

I am currently trying to develop an Azure DevOps extension.
What I want is the current user to be authenticated at an external service (website) that uses an app registration.
Could somebody guide me into the right direction? I've been looking around but can't seem to find the correct way to handle this.

1 Reply

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi Moritz_Second,

    there are several methods to authenticate a user in an Azure DevOps extension and link their authentication to an external service using an app registration.

    Here are two common approaches (methodes):

    Method 1: OAuth 2.0 Provider for Azure Pipelines:

    1. App Registration Setup:

      • Start by creating an app registration in Azure Active Directory, and obtain the client ID and client secret.
    2. Extension Configuration:

      • Configure the OAuth 2.0 provider within your Azure DevOps extension.
    3. User Authentication:

      • Your extension can now authenticate the user with the external service using OAuth 2.0, which is supported by many services like GitHub, Azure Active Directory, and Google.
    4. Access Token Usage:

      • Once the user is authenticated, your extension can acquire an access token, which allows it to make requests to the external service on the user's behalf.

    Method 2: Azure DevOps Service Endpoint Framework:

    1. Service Endpoint Definition:

      • Create a service endpoint definition for the external service within Azure DevOps.
    2. Azure AD Configuration:

      • Configure this service endpoint definition to use the app registration you created in Azure Active Directory.
    3. Service Endpoint Connection:

      • Establish a service endpoint connection to the external service.
    4. User Authentication:

      • Your extension can use this service endpoint connection to authenticate the user to the external service.
    5. Access Token Usage:

      • Similar to the OAuth approach, you can obtain an access token and employ it to make requests to the external service on behalf of the user.

    The choice between these methods depends on the specific needs of your extension. If your external service doesn't support the OAuth 2.0 protocol, you may opt for the service endpoint framework. However, if OAuth 2.0 is supported, you can choose either method.

    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)

Resources