Codota Logo
OidcAuthorizationCodeAuthenticationProvider.setJwtDecoderFactory
Code IndexAdd Codota to your IDE (free)

How to use
setJwtDecoderFactory
method
in
org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider

Best Java code snippets using org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider.setJwtDecoderFactory (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-security

private void setUpIdToken(Map<String, Object> claims, Instant issuedAt, Instant expiresAt) {
  Map<String, Object> headers = new HashMap<>();
  headers.put("alg", "RS256");
  Jwt idToken = new Jwt("id-token", issuedAt, expiresAt, headers, claims);
  JwtDecoder jwtDecoder = mock(JwtDecoder.class);
  when(jwtDecoder.decode(anyString())).thenReturn(idToken);
  this.authenticationProvider.setJwtDecoderFactory(registration -> jwtDecoder);
}
origin: spring-projects/spring-security

@Test
public void setJwtDecoderFactoryWhenNullThenThrowIllegalArgumentException() {
  this.exception.expect(IllegalArgumentException.class);
  this.authenticationProvider.setJwtDecoderFactory(null);
}
origin: spring-projects/spring-security

@Test
public void authenticateWhenIdTokenValidationErrorThenThrowOAuth2AuthenticationException() {
  this.exception.expect(OAuth2AuthenticationException.class);
  this.exception.expectMessage(containsString("[invalid_id_token] ID Token Validation Error"));
  JwtDecoder jwtDecoder = mock(JwtDecoder.class);
  when(jwtDecoder.decode(anyString())).thenThrow(new JwtException("ID Token Validation Error"));
  this.authenticationProvider.setJwtDecoderFactory(registration -> jwtDecoder);
  this.authenticationProvider.authenticate(
      new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
}
origin: spring-projects/spring-security

JwtDecoderFactory<ClientRegistration> jwtDecoderFactory = this.getJwtDecoderFactoryBean();
if (jwtDecoderFactory != null) {
  oidcAuthorizationCodeAuthenticationProvider.setJwtDecoderFactory(jwtDecoderFactory);
org.springframework.security.oauth2.client.oidc.authenticationOidcAuthorizationCodeAuthenticationProvidersetJwtDecoderFactory

Javadoc

Sets the JwtDecoderFactory used for OidcIdToken signature verification. The factory returns a JwtDecoder associated to the provided ClientRegistration.

Popular methods of OidcAuthorizationCodeAuthenticationProvider

  • <init>
  • setAuthoritiesMapper
  • createOidcToken
  • authenticate
  • getJwtDecoder
  • supports

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Notification (javax.management)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now