-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Azure Identity => ERROR in getToken() call for scopes [https://ossrdbms-aad.database.windows.net/.default]: Managed Identity authentication is not available #39548
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
We also have the same problem. It seems like the azure-identity-extensions for Java used for authenticating is not supporting Workload Identity. I also opened a issue yesterday The auth flow for fyi: #39540 |
Hello @SwatiBaffle We'll take a look at this and get back to you soon. |
Any Update here |
Any update on this issue? I am also facing same issue..I am using using azure-identity library with version 1.12.0. DefaultAzureCredential managedIdentityCredentialUserAssigned = new DefaultAzureCredentialBuilder()
Here bd947a20-baf1-4009-ab9a-c8aa361527a6 is clientId corresponding to the managed Identity. [DEBUG] com.azure.identity.ManagedIdentityCredential - Azure Identity => ERROR in getToken() call for scopes []: Managed Identity authentication is not available. Is this a defect in Azure SDK for java as discussed above? |
Use the WorkloadIdentityCredential to target WorkloadIdentity directly. TokenCredential workloadIdentityCredential = new WorkloadIdentityCredentialBuilder().build(); If the issue persists, |
Please share some snippet of code which show how jdbc client with workload identity works with workload identity. That's will be helpful |
a) Set up postgres database with managed identity
b) add this managedIdentity in database
psql "host= dbname=postgres user= password=$PGPASSWORD" -c "select * from pgaadauth_create_principal_with_oid(,, 'service', false, false);"
b) Create app which will create JDBC connectivity using postgres db(enabled workload identity)
c) Deploy this app using K8 env and verify the flow with JDBC connection
k8 already using azure.workload.identity/use: "true"
as well as for Service account - azure.workload.identity/client-id:
There are two issue which is faced during this setup
TokenCredential managedIdentityCredential = (new ManagedIdentityCredentialBuilder()).clientId(clientId).build();
String accessToken = ((AccessToken)managedIdentityCredential.getToken((new TokenRequestContext()).addScopes(new String[]{"https://ossrdbms-aad.database.windows.net/.default"})).block()).getToken();
which error out as below
ERROR ManagedIdentityCredential:553 - Azure Identity => ERROR in getToken() call for scopes [https://ossrdbms-aad.database.windows.net/.default]: Managed Identity authentication is not available.
error out as below
org.postgresql.util.PSQLException: SSL error: Certificates do not conform to algorithm constraints
Looking for reference doc and step here
create postgres database with workload identity
create JDBC app to connect with postgres database
The text was updated successfully, but these errors were encountered: