Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gov cloud] Not able to fetch secrets from Azure US Gov - AADSTS900382: Confidential Client is not supported in Cross Cloud #66

Open
bhagathkumar opened this issue Oct 13, 2020 · 13 comments

Comments

@bhagathkumar
Copy link

Your checklist for this issue

  • [ x] Jenkins version : 2.249.1

  • [x ] Plugin version : 2.0

  • [x ] OS : RHEL7

Description

When configuring key vault from Azure US gov .Test connection gives below error.

Max retries 3 times exceeded. Error Details: AADSTS900382: Confidential Client is not supported in Cross Cloud request.
Trace ID: xxxxx
Correlation ID: xxxxx
Timestamp: 2020-10-12 10:09:35Z
com.microsoft.aad.msal4j.MsalServiceException: AADSTS900382: Confidential Client is not supported in Cross Cloud request.

Trace ID: xxxxx

Correlation ID: xxxxx

Timestamp: 2020-10-12 10:09:35Z
at com.microsoft.aad.msal4j.MsalServiceExceptionFactory.fromHttpResponse(MsalServiceExceptionFactory.java:46)
at com.microsoft.aad.msal4j.TokenRequest.executeOauthRequestAndProcessResponse(TokenRequest.java:109)
at com.microsoft.aad.msal4j.ClientApplicationBase.acquireTokenCommon(ClientApplicationBase.java:163)
at com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier.execute(AcquireTokenByAuthorizationGrantSupplier.java:52)
at com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:57)

But key vault from azure cloud. I am able to test the connection as well as retrieve the secrets.

@timja
Copy link
Member

timja commented Oct 13, 2020

@xuzhang3 any idea?

@bhagathkumar
Copy link
Author

I think AzureCredentialBuilder() is changed in com.azure:azure-identity 1.1.0 which include the support for azure gov subscriptions.

Ref:
https://blog.jongallant.com/2020/02/azure-identity-other-clouds/
https://stackoverflow.com/questions/62052854/how-connect-to-azure-key-vault-from-java-backend-using-azure-java-sdk

@timja
Copy link
Member

timja commented Oct 13, 2020

ah sure, try set that environment variable otherwise PRs are welcome.

@bhagathkumar
Copy link
Author

Tried with setting environment variable for jenkins runtime

option1 ,AZURE_AUTHORITY_HOST="https://login.microsoftonline.us"

option2, AZURE_AUTHORITY_HOST=https://login.microsoftonline.us

In Both ways.Its not working.
Got the same error message.

@timja
Copy link
Member

timja commented Oct 13, 2020

where were you setting it?
I would expect you need to set it before Jenkins starts, maybe in pipeline it could work.

@bhagathkumar
Copy link
Author

I am running jenkins as Docker .

Setting the environment variable in docker-compose.yml as below.

environment:

@bhagathkumar
Copy link
Author

after setting in docker-compose.yml also .I am getting same error.
Is there any other fixes i can try?

@lovleshmalik
Copy link

I am also getting the similar error on Azure GovCloud. @bhagathkumar any luck solving this?

@timja
Copy link
Member

timja commented May 7, 2021

@lovleshmalik @bhagathkumar
Can either of you try on https://github.com/jenkinsci/azure-keyvault-plugin/releases/tag/120.v42d9117f490e

I did some improvements in the azure-credentials plugin to resolve the environment properly I think, but I have no way of testing it

@bkarlow-optimo
Copy link

I am seeing this same error.

Has anyone made progress on a fix?

@timja
Copy link
Member

timja commented Oct 8, 2021

this really needs someone with a us gov account to do it.

Are you seeing the same stacktrace @bkarlow-optimo ?

Have you configured a us gov endpoint on your credential?

@bkarlow-optimo
Copy link

Yes, same.

@timja timja changed the title Not able to fetch secrets from Azure US Gov - AADSTS900382: Confidential Client is not supported in Cross Cloud [gov cloud] Not able to fetch secrets from Azure US Gov - AADSTS900382: Confidential Client is not supported in Cross Cloud Dec 5, 2022
@aktiver
Copy link

aktiver commented Mar 17, 2023

The new-ish api also uses "https://management.core.usgovcloudapi.net" for its endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants