nl.surfnet.coin.api.client
Interface OpenConextOAuthClient

All Known Implementing Classes:
OpenConextOAuthClientImpl

public interface OpenConextOAuthClient

Capable of retrieving OpenSocial data from OpenSocial endpoints


Method Summary
 String getAuthorizationUrl()
          Get the authorization url
 Group20 getGroup20(String userId, String groupId, String onBehalfOf)
          Get group information about the given group, for the given user.
 List<Person> getGroupMembers(String groupId, String onBehalfOf)
          Get the group members of the given group.
 List<Group> getGroups(String userId, String onBehalfOf)
          Get Persons' Groups
 List<Group20> getGroups20(String userId, String onBehalfOf)
          Get Persons' Groups
 Person getPerson(String userId, String onBehalfOf)
          Get the OpenSocial Person.
 boolean isAccessTokenGranted(String userId)
          Is it possible to make OpenSocial requests for this user (as onBehalfOf).
 void oauthCallback(javax.servlet.http.HttpServletRequest request, String onBehalfOf)
          Clients who have requested a redirect to the authorization URL will be notified on the registered callback URL.
 

Method Detail

isAccessTokenGranted

boolean isAccessTokenGranted(String userId)
Is it possible to make OpenSocial requests for this user (as onBehalfOf). In principle clients need to make this check every time they want to make a three-legged oauth call.

Parameters:
userId - the unique identifier
Returns:
true if there is a valid access token for the user

getAuthorizationUrl

String getAuthorizationUrl()
Get the authorization url

Returns:
the authorization url

oauthCallback

void oauthCallback(javax.servlet.http.HttpServletRequest request,
                   String onBehalfOf)
Clients who have requested a redirect to the authorization URL will be notified on the registered callback URL. For extracting the oauth access token they will need to 'forward' the call back request to this method.

Parameters:
request - the HTTP request for obtaining the request token
onBehalfOf - the userId of the end user

getPerson

Person getPerson(String userId,
                 String onBehalfOf)
Get the OpenSocial Person. Note that the onBehalfOf is only necessary if this is a three-legged call (e.g. there is an access token for the onBehalfOf). For two legged calls the onBehalfOf can be null.

Parameters:
userId - the unique identifier
onBehalfOf - the unique identifier of the user that is going to make the request
Returns:
the Person

getGroupMembers

List<Person> getGroupMembers(String groupId,
                             String onBehalfOf)
Get the group members of the given group. Note that the onBehalfOf is only necessary if this is a three-legged call (e.g. there is an access token for the onBehalfOf). For two legged calls the onBehalfOf can be null.

Parameters:
groupId - String the unique identifier for the group
onBehalfOf - String the unique identifier of the user that is going to make the request
Returns:
an ArrayList containing Person's

getGroups

List<Group> getGroups(String userId,
                      String onBehalfOf)
Get Persons' Groups

Parameters:
userId - the unique identifier
onBehalfOf - the unique identifier of the user that is going to make the request
Returns:
List containing the Groups

getGroups20

List<Group20> getGroups20(String userId,
                          String onBehalfOf)
Get Persons' Groups

Parameters:
userId - the unique identifier
onBehalfOf - the unique identifier of the user that is going to make the request
Returns:
List containing the Groups

getGroup20

Group20 getGroup20(String userId,
                   String groupId,
                   String onBehalfOf)
Get group information about the given group, for the given user.

Parameters:
userId - the userId that is a member of the given group
groupId - the groupId of the group
onBehalfOf - id of the end user on whose behalf this call is done.
Returns:
Group object


Copyright © 2009-2013 SURFnet bv, The Netherlands. All Rights Reserved.