Skip to content

Commit

Permalink
feat: add oauth scope (for entra id) (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
tea-one authored Oct 16, 2024
1 parent 81f4a22 commit 40138fc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private HttpPost buildRequest() throws URISyntaxException {
formParams.add(new BasicNameValuePair("client_id", jwtCredential.clientId()));
formParams.add(new BasicNameValuePair("client_secret", jwtCredential.clientSecret()));
formParams.add(new BasicNameValuePair("audience", jwtCredential.audience()));
formParams.add(new BasicNameValuePair("scope", jwtCredential.scope()));
httpPost.setEntity(new UrlEncodedFormEntity(formParams));
return httpPost;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

import java.net.URL;

public record JwtCredential(String clientId, String clientSecret, String audience, URL authUrl) {}
public record JwtCredential(
String clientId, String clientSecret, String audience, URL authUrl, String scope) {}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public Authentication authentication() {
properties.clientId(),
properties.clientSecret(),
properties.audience(),
properties.authUrl()),
properties.authUrl(),
properties.scope()),
new JacksonTokenResponseMapper(objectMapper));
}
default -> throw new IllegalStateException("Unsupported profile: " + properties.profile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public record OperateClientConfigurationProperties(
String clientSecret,
URL authUrl,
String audience,
String scope,
// saas auth properies
String region,
String clusterId) {
Expand Down

0 comments on commit 40138fc

Please sign in to comment.