55import com .example .service .AuthorizationDetailsJwtClientParametersConverter ;
66import com .example .service .HelseIDClientCredentialTokenService ;
77import com .example .service .HelseIDDPoPClientCredentialTokenService ;
8- import java .time .Duration ;
98import lombok .extern .slf4j .Slf4j ;
109import org .springframework .beans .factory .annotation .Qualifier ;
1110import org .springframework .boot .autoconfigure .security .oauth2 .client .ConditionalOnOAuth2ClientRegistrationProperties ;
@@ -85,15 +84,14 @@ public HelseIDClientCredentialTokenService helseIDClientCredentialTokenService(
8584 OAuth2AuthorizedClientService oAuth2AuthorizedClientService ,
8685 @ Qualifier ("authorizationCredentialsGrantResponseClient" )
8786 OAuth2AccessTokenResponseClient <OAuth2ClientCredentialsGrantRequest >
88- authorizationCredentialsGrantResponseClient ) {
87+ tokenResponseClient ) {
8988
9089 ClientRegistration clientRegistration =
9190 clientRegistrationRepository .findByRegistrationId (HELSEID_CREDENTIALS );
9291
9392 ClientCredentialsOAuth2AuthorizedClientProvider clientCredentialsAuthorizedClientProvider =
9493 new ClientCredentialsOAuth2AuthorizedClientProvider ();
95- clientCredentialsAuthorizedClientProvider .setAccessTokenResponseClient (
96- authorizationCredentialsGrantResponseClient );
94+ clientCredentialsAuthorizedClientProvider .setAccessTokenResponseClient (tokenResponseClient );
9795
9896 return new HelseIDClientCredentialTokenService (
9997 clientRegistration ,
@@ -108,20 +106,18 @@ public HelseIDDPoPClientCredentialTokenService helseIdApiDPOPClientCredentialTok
108106 DPoPProofBuilder dPoPProofBuilder ,
109107 @ Qualifier ("authorizationCredentialsGrantResponseDpopClient" )
110108 OAuth2AccessTokenResponseClient <OAuth2ClientCredentialsGrantRequest >
111- authorizationCredentialsGrantResponseDpopClient ) {
109+ dPoPTokenResponseClient ) {
112110 ClientRegistration clientRegistration =
113111 clientRegistrationRepository .findByRegistrationId (HELSEID_CREDENTIALS );
114112
115113 ClientCredentialsOAuth2AuthorizedClientProvider clientCredentialsAuthorizedClientProvider =
116114 new ClientCredentialsOAuth2AuthorizedClientProvider ();
117- clientCredentialsAuthorizedClientProvider .setAccessTokenResponseClient (
118- authorizationCredentialsGrantResponseDpopClient );
115+ clientCredentialsAuthorizedClientProvider .setAccessTokenResponseClient (dPoPTokenResponseClient );
119116
120117 return new HelseIDDPoPClientCredentialTokenService (
121118 clientRegistration ,
122119 dPoPProofBuilder ,
123120 oAuth2AuthorizedClientService ,
124- clientCredentialsAuthorizedClientProvider ,
125- Duration .ofMinutes (2 ));
121+ clientCredentialsAuthorizedClientProvider );
126122 }
127123}
0 commit comments