use of com.google.api.client.googleapis.auth.oauth2.GooglePublicKeysManager in project molgenis by molgenis.
the class GoogleAuthenticationProcessingFilterTest method setUp.
@BeforeMethod
public void setUp() {
authenticationSettings = mock(AuthenticationSettings.class);
UserDetailsService userDetailsService = mock(UserDetailsService.class);
DataService dataService = mock(DataService.class);
GooglePublicKeysManager googlePublicKeysManager = mock(GooglePublicKeysManager.class);
UserFactory userFactory = mock(UserFactory.class);
GroupMemberFactory groupMemberFactory = mock(GroupMemberFactory.class);
googleAuthenticationProcessingFilter = new GoogleAuthenticationProcessingFilter(googlePublicKeysManager, dataService, userDetailsService, authenticationSettings, userFactory, groupMemberFactory);
request = mock(HttpServletRequest.class);
response = mock(HttpServletResponse.class);
}
use of com.google.api.client.googleapis.auth.oauth2.GooglePublicKeysManager in project molgenis by molgenis.
the class MolgenisWebAppSecurityConfig method googlePublicKeysManager.
@Bean
public GooglePublicKeysManager googlePublicKeysManager() {
HttpTransport transport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();
return new GooglePublicKeysManager(transport, jsonFactory);
}
use of com.google.api.client.googleapis.auth.oauth2.GooglePublicKeysManager in project molgenis by molgenis.
the class GoogleAuthenticationProcessingFilter method verify.
private GoogleIdToken verify(String idTokenString) throws GeneralSecurityException, IOException {
List<String> audience = Collections.singletonList(authenticationSettings.getGoogleAppClientId());
GoogleIdTokenVerifier googleIdTokenVerifier = new GoogleIdTokenVerifier.Builder(googlePublicKeysManager).setAudience(audience).build();
return googleIdTokenVerifier.verify(idTokenString);
}
Aggregations