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

Version 6.4.0: Cannot get configured certificate(s) for an application #1878

Open
vipetrov-bg opened this issue Mar 8, 2024 · 0 comments
Open

Comments

@vipetrov-bg
Copy link

vipetrov-bg commented Mar 8, 2024

Expected behavior

Have at least one configured certificate

Perform request
Application app= graphClient.applications().byApplicationId(applicationId).get();
as
app.getKeyCredentials().get(0).getKey() is null!

Actual behavior

The app.getKeyCredentials().get(0).getKey() should not be null, expected certificate in byte format.

Steps to reproduce the behavior

TokenCredential tokenCredential = new ClientCertificateCredentialBuilder().tenantId(tenantId)
.clientId(clientId).pfxCertificate(pfxCertificatePath).clientCertificatePassword(pfxPassword)
.build();

String[] scopes = new String[] { "https://graph.microsoft.com/.default" };

GraphServiceClient graphClient = new GraphServiceClient(tokenCredential, scopes);

// Have at least one configured certificate for "<my app id>"
Application app = graphClient.applications().byApplicationId("<my app id>").get();

List<KeyCredential> keyCredentialList = app.getKeyCredentials();

keyCredentialList.get(0).getKey() is null!

The other properties are OK.
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

1 participant