Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring security Oauth2 client ClientAuthenticationProcessingFilter
    text
    copied!<p>I'm working on spring-security-oauth2-1.0.3.RELEASE, trying to set up an oauth client to get user authenticated with google.</p> <p>I spent quit a while on this and still don't find much good article explaining very clearly.</p> <p>What I'm doing is to put an OAuth2ClientAuthenticationProcessingFilter into the filter chain like this:</p> <pre><code>&lt;http xmlns="http://www.springframework.org/schema/security" use-expressions="true" pattern="/oauth.html" auto-config="true"&gt; &lt;sec:intercept-url pattern="/**" access="isFullyAuthenticated()" /&gt; &lt;custom-filter ref="oauth2ClientFilter" position="CAS_FILTER" /&gt; &lt;sec:custom-filter ref="googleAuthFilter" after="CAS_FILTER" /&gt; &lt;/http&gt; </code></pre> <p>A custom-filter: googleAuthFilter is there to protect my URL.</p> <p>Reading the source code of OAuth2ClientAuthenticationProcessingFilter, it requires a reference to </p> <ol> <li>an OAuth2RestOperations (rest template) which refers to an Oauth server resource (information about google)</li> <li>ResourceServerTokenServices (<strong>from Spring-security-oauth libary provider packages</strong>).</li> </ol> <p>Now I'm confused. Spring-security-oauth is divided into 2 parts: client and provider.</p> <p>Since I'm just setting up an Oauth client, <strong>why do I need to have a reference of a class from Oauth provider packages?</strong></p> <p>Also, How should I set up the ResourceServerTokenServices? Now I'm trying to use the defualt implementaiton. Because DefaultTokenServices again requires reference to </p> <ol> <li>TokenStore</li> <li>ClientDetailsService</li> <li>TokenEnhancer</li> </ol> <p>So far I tried all the default implementations:</p> <ul> <li>TokenStore: InMemoryTokenStore</li> <li>ClientDetailsService: InMemoryClientDetailsService</li> <li>TokenEnhancer: TokenEnhancerChain</li> </ul> <p>and it seems not to work...</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload