Announcement Announcement Module
Collapse
No announcement yet.
response object in OAuth dance using OAuth2 Service Provider Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • response object in OAuth dance using OAuth2 Service Provider

    Hi all,
    I am sure I am missing somethign reaaly obvious here. Anyway I hope someone can help me quick . In the Spring Social reference documentation http://static.springsource.org/sprin...eprovider.html there is a block:
    Code:
    FacebookConnectionFactory connectionFactory = new FacebookConnectionFactory("clientId", "clientSecret");
    OAuth2Operations oauth2Operations = connectionFactory.getOAuth2Operations();
    String authorizeUrl = oauth2Operations.buildAuthorizeUrl(GrantType.AUTHORIZATION_CODE, new OAuth2Parameters("callbackUrl"));
    response.sendRedirect(authorizeUrl);
    // when the provider callback is received with the authorizationCode parameter:
    AccessGrant accessGrant = oauth2Operations.exchangeForAccess(authorizationCode, "callbackUrl");
    Connection<FacebookApi> connection = connectionFactory.createConnection(accessGrant);

    what is this response object? where does it come from?

    Thanks in advance for the help

    T
    Last edited by taff; Jun 1st, 2011, 04:52 AM.

  • #2
    The response object is an HttpServletResponse. Although not explicitly stated (perhaps it should be), that block of code is assumed to be in a Spring MVC controller method where the HttpServletResponse is available to perform the redirect to the provider's authorization page.

    Comment


    • #3
      Thanks Habuma for that,
      and sorry for replying so late (was on another project at short notice)
      I knew it was something as triial as that.
      I am actually trying to use spring-social from inside apache-wicket.
      Thanks
      T

      Comment

      Working...
      X