-
Notifications
You must be signed in to change notification settings - Fork 22
feat: support provider:client for IAS app-to-app #986
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -589,6 +589,66 @@ void testClientIdWithTenantId() | |
| PROVIDER_TENANT_ID)); | ||
| } | ||
|
|
||
| @Test | ||
| void testProviderClientId() | ||
| { | ||
| @SuppressWarnings( "deprecation" ) | ||
| final ServiceBindingDestinationOptions options = | ||
| ServiceBindingDestinationOptions | ||
| .forService(BINDING) | ||
| .withOption(IasOptions.withProviderClient("provider-client-id")) | ||
| .build(); | ||
|
|
||
| final OAuth2PropertySupplier sut = IDENTITY_AUTHENTICATION.resolve(options); | ||
|
|
||
| assertThat(sut).isNotNull(); | ||
| assertThat(sut.getTokenUri()).hasToString(PROVIDER_URL + "/oauth2/token"); | ||
| assertThat(sut.getServiceUri()).hasToString(PROVIDER_URL); | ||
|
|
||
| final OAuth2Options oAuth2Options = sut.getOAuth2Options(); | ||
| assertThat(oAuth2Options.skipTokenRetrieval()).isFalse(); | ||
| assertThat(oAuth2Options.getClientKeyStore()).isNotNull(); | ||
| assertThatClientCertificateIsContained(oAuth2Options.getClientKeyStore()); | ||
| assertThat(oAuth2Options.getAdditionalTokenRetrievalParameters()) | ||
| .containsExactlyInAnyOrderEntriesOf( | ||
| Map | ||
| .of( | ||
| "resource", | ||
| "urn:sap:identity:application:provider:clientid:provider-client-id", | ||
| "app_tid", | ||
| PROVIDER_TENANT_ID)); | ||
| } | ||
|
|
||
| @Test | ||
| void testProviderClientIdWithTenantId() | ||
| { | ||
| @SuppressWarnings( "deprecation" ) | ||
| final ServiceBindingDestinationOptions options = | ||
| ServiceBindingDestinationOptions | ||
| .forService(BINDING) | ||
| .withOption(IasOptions.withProviderClient("provider-client-id", "provider-tenant-id")) | ||
| .build(); | ||
|
|
||
| final OAuth2PropertySupplier sut = IDENTITY_AUTHENTICATION.resolve(options); | ||
|
|
||
| assertThat(sut).isNotNull(); | ||
| assertThat(sut.getTokenUri()).hasToString(PROVIDER_URL + "/oauth2/token"); | ||
| assertThat(sut.getServiceUri()).hasToString(PROVIDER_URL); | ||
|
|
||
| final OAuth2Options oAuth2Options = sut.getOAuth2Options(); | ||
| assertThat(oAuth2Options.skipTokenRetrieval()).isFalse(); | ||
| assertThat(oAuth2Options.getClientKeyStore()).isNotNull(); | ||
| assertThatClientCertificateIsContained(oAuth2Options.getClientKeyStore()); | ||
| assertThat(oAuth2Options.getAdditionalTokenRetrievalParameters()) | ||
| .containsExactlyInAnyOrderEntriesOf( | ||
| Map | ||
| .of( | ||
| "resource", | ||
| "urn:sap:identity:application:provider:clientid:provider-client-id:apptid:provider-tenant-id", | ||
| "app_tid", | ||
| PROVIDER_TENANT_ID)); | ||
|
Comment on lines
+647
to
+649
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, the term
I don't see an easy way to resolve this confusion, other than adding an explicit comment here that the difference |
||
| } | ||
|
|
||
| @AllArgsConstructor | ||
| private enum MutualTlsForTechnicalProviderAuthenticationTest | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.