WebUser login
grin-global-ui#139 (closed) asks for support for login of WebUser
using OAuth Password credentials (username+password provided by the user).
This requires checking user credentials against a new webUserDetailsService
and WebUser
needs to implement UserDetails
.
One idea is to add another AuthorizationServer
to OAuth2ServerConfig
:
@Configuration
@EnableAuthorizationServer
protected class WebUserAuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
This WebUserAuthorizationServerConfiguration
will need to be available on a different URL (the default /oauth/.. is already used). I hope this can be achieved by setting just the prefix
:
@Override
public void configure(final AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
final TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(accessTokenConverter()));
endpoints
.prefix("/webauth") // Prefix
.tokenStore(tokenStore())
.authorizationCodeServices(authorizationCodeServices())
.tokenEnhancer(tokenEnhancerChain)
.userDetailsService(webUserDetailsService) // webUserDetailsService
.authenticationManager(authenticationManager);
}