1

I have a question about Spring Social. The documentation of ProviderSigninController says:

When authenticating via an OAuth 2 provider, ProviderSignInController supports the following flow:

**1 -** POST /signin/{providerId} - Initiates the sign in flow by redirecting to 
        the provider's authentication endpoint.

**2 -** GET /signin/{providerId}?code={verifier} - Receives the authentication 
        callback from the provider, accepting a code. Exchanges this code for an 
        access token. Using this access token, it retrieves the user's provider 
        user ID and uses that to lookup a connected account and then 
        authenticates to the application through the sign in service.

    **2-a** If the provider user ID doesn't match any existing connection, 
        ProviderSignInController will redirect to a sign up URL. The default sign
        up URL is "/signup" (relative to the application root), but can be
        customized by setting the signUpUrl property.

    **2-b** If the provider user ID matches more than one existing connection, 
        ProviderSignInController will redirect to the application's sign 
        in URL to offer the user a chance to sign in through another provider 
        or with their username and password. The request to the sign in URL will 
        have an "error" query parameter set to "multiple_users" to indicate 
        the problem so that the page can communicate it to the user. The default
        sign in URL is "/signin" (relative to the application root), 
        but can be customized by setting the signInUrl property.

    **2-c** If any error occurs while fetching the access token or while fetching
        the user's profile data, ProviderSignInController will redirect to the 
        application's sign in URL. The request to the sign in URL will have an 
        "error" query parameter set to "provider" to indicate an error occurred 
        while communicating with the provider. The default sign in URL is 
        "/signin" (relative to the application root), but can be customized by 
        setting the signInUrl property.

This means that i have to map /signin to a view?

Reference: http://docs.spring.io/spring-social/docs/1.1.0.M4/reference/html/signin.html

Update: I modified my configuration.So i specify in configuration signup url and signinurl. Now i facing to an error problem i don't understand. My oAuth dance comes to step 2-c but the i am redirect to the signinurl with error=provider. It's an error about provider. When i consult the log, i have the following message :

[org.springframework.social.connect.web.ProviderSignInController] [] http-bio-8080-exec-10 Exception while handling OAuth2 callback (No Session found for current thread). Redirecting to /login

Which session is about ? I don't understand. Here is the complete log file http://pastebin.com/wzL4ZQFk

2
  • I think it means the controller handles the /signin view, but you are responsible for the /signup view.
    – CodeChimp
    Mar 12, 2014 at 20:29
  • It looks to me like the sign in is working but your app is failing when it tries to persist the Connection. Are you using a database or in-memory persistence?
    – Alex
    Mar 17, 2014 at 16:14

1 Answer 1

0

No, when POSTing to /signin/{providerId}, you will be redirected to the authentication screen of facebook, twitter, google or whatever the provider specified in 'providerId'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.