Spring OAuth2 authorization server: how to get client_id in user details service

Viewed 177

Given I have multiple clients registered in in-memory ClientDetailsServiceConfigurer

like this :

    clients.inMemory()..withClient("fooClientIdPassword").secret("secret")
            .authorizedGrantTypes("password", "client_credentials", "refresh_token").scopes("foo", "read", "write","notifications", "gist")
            .accessTokenValiditySeconds(3600)
            // 1 hour
            .refreshTokenValiditySeconds(2592000)
            // 30 days

            .and().withClient("barClientIdPassword").secret("secret")
            .authorizedGrantTypes("password", "client_credentials", "refresh_token").scopes("bar", "read", "write","notifications", "gist")
            .accessTokenValiditySeconds(3600)
            // 1 hour
            .refreshTokenValiditySeconds(2592000) // 30 days

how to get the client id used in the authentication request in my implemented UserDetailsService in additional to the provided username

0 Answers
Related