Share via

how to solve redirect url mis match with jenkins log in through azure

Deepa T 0 Reputation points
2025-07-24T20:11:28.06+00:00

AADSTS50011: The redirect URI 'https://20.66.106.78:8080/securityRealm/finishLogin' specified in the request does not match the redirect URIs configured for the application '381c0ec1-ede9-43d2-8c6d-2f970e0de004'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

Microsoft Teams | Microsoft Teams for education | Insights

1 answer

Sort by: Most helpful
  1. Ryan-N 13,740 Reputation points Microsoft External Staff Moderator
    2025-07-24T21:47:28.3533333+00:00

    Hi @Deepa T,

    Thank you for reaching out. Below is a detailed guide to help you resolve the AADSTS50011 error related to redirect URI mismatch when integrating Jenkins with Azure Active Directory (Azure AD).

    1. Identify the Application ID

    • Go to Jenkins → Azure AD Plugin → locate the Application (Client) ID.
    • Or copy it from the error message: 381c0ec1-ede9-43d2-8c6d-2f970e0de004.

    2. Access Azure Portal

    • Log in to https://portal.azure.com.
    • Navigate to Azure Active Directory > App Registrations.
    • Search for the application using the Application ID or name (e.g., “Jenkins”).

    3. Configure the Redirect URI

    • Open the Authentication section of the app.
    • Under Platform configurations, ensure the Web platform is selected.
    • Add the following Redirect URI:

    https://20.66.106.78:8080/securityRealm/finishLogin

    • Make sure the following components match exactly:
      • Scheme: https
      • IP/domain: 20.66.106.78
      • Port: 8080
      • Path: /securityRealm/finishLogin

     If Jenkins uses a domain (e.g., jenkins.yourcompany.com) or a different port, use that exact address instead.

    4. Verify Jenkins Configuration

    • Go to Manage Jenkins > Configure System.
    • Ensure the Jenkins Root URL matches the Redirect URI added in Azure AD.

    5. Enable ID Token (if needed)

    • In the Implicit grant and hybrid flows section, enable ID tokens.

    6. Save and Wait for Propagation

    • Click Save to apply changes.
    • Azure AD may take 3–5 minutes to fully update.

    Test the Login

    • Return to Jenkins and attempt to log in via Azure AD.
    • If the error persists:
      • Use an incognito/private browser window to avoid cached sessions.
      • Double-check that the Redirect URI in the error message matches exactly with the one added.

    Additional Considerations

    • Multiple Access URLs: If Jenkins is accessible via multiple addresses (IP, domain, ports), add each one as a Redirect URI in Azure AD.
    • Correct App Registration: Ensure you are editing the correct app with the matching Application ID.
    • Trailing Slash or Case Sensitivity: If you suspect a mismatch due to minor formatting, delete the incorrect URI and re-add the correct one.
    • HTTPS Requirement: Azure AD requires https:// for Redirect URIs (except for http://localhost in development).
    • Proxy or Load Balancer: If Jenkins is behind a proxy, ensure it generates the correct public-facing Redirect URI.
    • Use Logs for Debugging: Check Jenkins logs and Azure AD sign-in logs for more details. Tools like Fiddler can help inspect the redirect_uri parameter.

    If you have any updates regarding the issue or any other questions, please feel free to share them with me.


     If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    User's image

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.