Class HvlAuthOidcProviderServerConfig

java.lang.Object
tr.com.havelsan.javarch.oauth.auth.starter.oidc.configuration.HvlAuthOidcProviderServerConfig

@Configuration @EnableWebSecurity @Import(HvlOAuthOidcConfiguration.class) public class HvlAuthOidcProviderServerConfig extends Object
Configuration for OAuth2.
  • Constructor Details

    • HvlAuthOidcProviderServerConfig

      public HvlAuthOidcProviderServerConfig()
  • Method Details

    • oauth2SecurityFilterChain

      @Bean @Order(-2147483648) public org.springframework.security.web.SecurityFilterChain oauth2SecurityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity, HvlOAuth2AuthEntryPointFilter loginUrlEntryPointFilter, tr.com.havelsan.javarch.security.context.repository.HvlSecurityContextRepository securityContextRepository, HvlJpaRegisteredClientRepository registeredClientRepository, org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, HvlAuthorizationDefaultConsentService authorizationConsentService, HvlOidcUserInfoMapper oidcUserInfoMapper) throws Exception
      Oauth 2 security filter chain security filter chain.
      Parameters:
      httpSecurity - the http security
      loginUrlEntryPointFilter - the login url entry point filter
      securityContextRepository - the security context repository
      registeredClientRepository - the hvl registered client service
      authorizationService - the authorization service
      authorizationConsentService - the hvl authorization consent service
      oidcUserInfoMapper - the hvl oidc user info mapper
      Returns:
      the security filter chain
      Throws:
      Exception - the exception
    • httpSessionEventPublisher

      @Bean public org.springframework.security.web.session.HttpSessionEventPublisher httpSessionEventPublisher()
    • jwtDecoder

      @Bean public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder(com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource)
      Jwt decoder jwt decoder.
      Parameters:
      jwkSource - the jwk source
      Returns:
      the jwt decoder
    • jwkSource

      @Bean public com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource(HvlJwkKeyService hvlJwkKeyService)
      Jwk source jwk source.
      Parameters:
      hvlJwkKeyService - the hvl jwk key service
      Returns:
      the jwk source
    • oidcProviderSettings

      @Bean public org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings oidcProviderSettings(HvlAuthProviderServerProperties hvlAuthProviderServerProperties)
      Oidc provider settings authorization server settings.
      Parameters:
      hvlAuthProviderServerProperties - the hvl auth provider server props
      Returns:
      the authorization server settings
    • authorizationService

      @ConditionalOnMissingBean @Bean public org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService()
      Authorization service oauth2 authorization service.
      Returns:
      the o auth 2 authorization service