Search in sources :

Example 1 with UsernameJaasAuthenticationProvider

use of com.thinkbiganalytics.auth.jaas.UsernameJaasAuthenticationProvider in project kylo by Teradata.

the class JaasAuthConfig method servicesTokenAuthenticationProvider.

@Bean(name = SERVICES_TOKEN_AUTH_PROVIDER)
public AbstractJaasAuthenticationProvider servicesTokenAuthenticationProvider(@Named("jaasConfiguration") javax.security.auth.login.Configuration config, List<AuthorityGranter> authorityGranters) {
    UsernameJaasAuthenticationProvider provider = new UsernameJaasAuthenticationProvider();
    provider.setCallbackHandlers(CALLBACK_HANDLERS);
    provider.setConfiguration(config);
    provider.setAuthorityGranters(authorityGranters.toArray(new AuthorityGranter[authorityGranters.size()]));
    provider.setLoginContextName(JAAS_SERVICES_TOKEN);
    return provider;
}
Also used : AuthorityGranter(org.springframework.security.authentication.jaas.AuthorityGranter) UserPrincipalAuthorityGranter(com.thinkbiganalytics.auth.UserPrincipalAuthorityGranter) DefaultPrincipalAuthorityGranter(com.thinkbiganalytics.auth.DefaultPrincipalAuthorityGranter) GroupPrincipalAuthorityGranter(com.thinkbiganalytics.auth.GroupPrincipalAuthorityGranter) UsernameJaasAuthenticationProvider(com.thinkbiganalytics.auth.jaas.UsernameJaasAuthenticationProvider) Bean(org.springframework.context.annotation.Bean)

Example 2 with UsernameJaasAuthenticationProvider

use of com.thinkbiganalytics.auth.jaas.UsernameJaasAuthenticationProvider in project kylo by Teradata.

the class JaasAuthConfig method uiTokenAuthenticationProvider.

@Bean(name = UI_TOKEN_AUTH_PROVIDER)
public AbstractJaasAuthenticationProvider uiTokenAuthenticationProvider(@Named("jaasConfiguration") javax.security.auth.login.Configuration config, List<AuthorityGranter> authorityGranters) {
    UsernameJaasAuthenticationProvider provider = new UsernameJaasAuthenticationProvider();
    provider.setCallbackHandlers(CALLBACK_HANDLERS);
    provider.setConfiguration(config);
    provider.setAuthorityGranters(authorityGranters.toArray(new AuthorityGranter[authorityGranters.size()]));
    provider.setLoginContextName(JAAS_UI_TOKEN);
    return provider;
}
Also used : AuthorityGranter(org.springframework.security.authentication.jaas.AuthorityGranter) UserPrincipalAuthorityGranter(com.thinkbiganalytics.auth.UserPrincipalAuthorityGranter) DefaultPrincipalAuthorityGranter(com.thinkbiganalytics.auth.DefaultPrincipalAuthorityGranter) GroupPrincipalAuthorityGranter(com.thinkbiganalytics.auth.GroupPrincipalAuthorityGranter) UsernameJaasAuthenticationProvider(com.thinkbiganalytics.auth.jaas.UsernameJaasAuthenticationProvider) Bean(org.springframework.context.annotation.Bean)

Aggregations

DefaultPrincipalAuthorityGranter (com.thinkbiganalytics.auth.DefaultPrincipalAuthorityGranter)2 GroupPrincipalAuthorityGranter (com.thinkbiganalytics.auth.GroupPrincipalAuthorityGranter)2 UserPrincipalAuthorityGranter (com.thinkbiganalytics.auth.UserPrincipalAuthorityGranter)2 UsernameJaasAuthenticationProvider (com.thinkbiganalytics.auth.jaas.UsernameJaasAuthenticationProvider)2 Bean (org.springframework.context.annotation.Bean)2 AuthorityGranter (org.springframework.security.authentication.jaas.AuthorityGranter)2