2013-12-12 1 views
0

Пытается использовать grails-spring-security-oauth2-provider в grails 2.2.4. Поток авторизации работает, но при повторном представлении кода для получения токена (через/myapp/oauth/token) я ожидал, что ClientCredentialsTokenEndpointFilter будет аутентифицировать запрос POST, но это не так. Я вижу это в цепочке фильтров.grails-spring-security-oauth2-provider ClientCredentials filter no processing/oauth/token

Кроме того, будет ли он использовать id/secret из моего определенного клиента в Config.groovy? Похоже, что сначала попробует мой DaoAuthenticationProvidor, и не сработает, и перейдем прямо к фильтру исключений (и перенаправляемся на конечную точку входа).

DEBUG web.FilterChainProxy - /oauth/token at position 5 of 11 in additional filter chain; firing Filter: 'RequestHolderAuthenticationFilter' 
DEBUG web.FilterChainProxy - /oauth/token at position 6 of 11 in additional filter chain; firing Filter: 'ClientCredentialsTokenEndpointFilter' 
DEBUG web.FilterChainProxy - /oauth/token at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter' 

Моя конфигурация:

 oauthProvider {    
      clients = [ 
        [ 
          clientId:"test", 
          clientSecret:"testSecret", 
          authorizedGrantTypes:["authorization_code"], 
          registeredRedirectUri:["http://myapp/other/"] 
        ] 
      ] 

     providerNames = [ 
       'samlAuthenticationProvider', 
       'daoAuthenticationProvider', 
       'anonymousAuthenticationProvider', 
       'rememberMeAuthenticationProvider', 
       'clientCredentialsAuthenticationProvider'] 
... 
       '/oauth/authorize.dispatch':['IS_AUTHENTICATED_REMEMBERED'], 
       '/oauth/token.dispatch':['IS_AUTHENTICATED_REMEMBERED'], 

Url отвечал:

http://localhost:8080/myapp/oauth/token 
grant_type=authorization_code 
client_id=test 
client_secret=testSecret 
code=<the code I got from authorization> 
redirect_uri=http:localhost:8080//myapp/other" 
+0

Верно ли, что адрес поставщика? Порядок важен и согласно документации clientCredentialsAuthenticationProvider должен быть первым. –

ответ

0

ли редирект Ури же во всех ваших запросов?