-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a CustomOidcReactiveOAuth2UserService bean.
- Added a CustomReactiveOAuth2UserService bean.
- Loading branch information
Showing
4 changed files
with
68 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...a/no/nav/testnav/apps/endringsmeldingfrontend/config/CustomReactiveOAuth2UserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package no.nav.testnav.apps.endringsmeldingfrontend.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest; | ||
import org.springframework.security.oauth2.client.userinfo.ReactiveOAuth2UserService; | ||
import org.springframework.security.oauth2.core.OAuth2AuthenticationException; | ||
import org.springframework.security.oauth2.core.user.OAuth2User; | ||
import reactor.core.publisher.Mono; | ||
|
||
import static lombok.AccessLevel.PACKAGE; | ||
|
||
@RequiredArgsConstructor(access = PACKAGE) | ||
class CustomReactiveOAuth2UserService implements ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> { | ||
|
||
@Override | ||
public Mono<OAuth2User> loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException { | ||
return Mono.empty(); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...n/java/no/nav/testnav/apps/endringsmeldingfrontend/config/CustomReactiveOauth2Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package no.nav.testnav.apps.endringsmeldingfrontend.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.oauth2.client.oidc.userinfo.OidcReactiveOAuth2UserService; | ||
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest; | ||
import org.springframework.security.oauth2.client.userinfo.ReactiveOAuth2UserService; | ||
import org.springframework.security.oauth2.core.user.OAuth2User; | ||
|
||
@Configuration | ||
public class CustomReactiveOauth2Config { | ||
|
||
@Bean | ||
public ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> reactiveOAuth2UserService() { | ||
return new CustomReactiveOAuth2UserService(); | ||
} | ||
|
||
@Bean | ||
public OidcReactiveOAuth2UserService oidcReactiveOAuth2UserService() { | ||
return new CustomOidcReactiveOAuth2UserService(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters