org.apache.shindig.social.core.oauth2
Class OAuth2ServiceImpl

java.lang.Object
  extended by org.apache.shindig.social.core.oauth2.OAuth2ServiceImpl
All Implemented Interfaces:
OAuth2Service

public class OAuth2ServiceImpl
extends java.lang.Object
implements OAuth2Service

A simple in-memory implementation of the OAuth 2 services.


Constructor Summary
OAuth2ServiceImpl(OAuth2DataService store)
           
 
Method Summary
 void authenticateClient(OAuth2NormalizedRequest req)
          Validates a client.
 OAuth2Code generateAccessToken(OAuth2NormalizedRequest req)
          Generates an access token from a client OAuth 2.0 request.
 OAuth2Code generateAuthorizationCode(OAuth2NormalizedRequest req)
          Generates an authorization code from a client OAuth 2.0 request.
 OAuth2Code generateRefreshToken(OAuth2NormalizedRequest req)
          Generates a refresh token from a client OAuth 2.0 request.
 OAuth2DataService getDataService()
          Retrieves the underlying data service.
 OAuth2Code grantAccessToken(OAuth2NormalizedRequest req)
          Grants an access token to the given client by generating and registering the access token.
 OAuth2Code grantAuthorizationCode(OAuth2NormalizedRequest req)
          Grants an authorization code to the given client by generating and registering the code.
 OAuth2Code grantRefreshToken(OAuth2NormalizedRequest req)
          Grants a refresh token to the given client by generating and registering the refresh token.
 void validateRequestForAccessToken(OAuth2NormalizedRequest req)
          Validates a client's request for an access token.
 void validateRequestForAuthCode(OAuth2NormalizedRequest req)
          Validates a client's request for an authorization token.
 void validateRequestForResource(OAuth2NormalizedRequest req, java.lang.Object resourceRequest)
          Validates a client's request to use access a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2ServiceImpl

@Inject
public OAuth2ServiceImpl(OAuth2DataService store)
Method Detail

getDataService

public OAuth2DataService getDataService()
Description copied from interface: OAuth2Service
Retrieves the underlying data service.

Specified by:
getDataService in interface OAuth2Service

authenticateClient

public void authenticateClient(OAuth2NormalizedRequest req)
                        throws OAuth2Exception
Description copied from interface: OAuth2Service
Validates a client.

Specified by:
authenticateClient in interface OAuth2Service
Throws:
OAuth2Exception

validateRequestForAuthCode

public void validateRequestForAuthCode(OAuth2NormalizedRequest req)
                                throws OAuth2Exception
Description copied from interface: OAuth2Service
Validates a client's request for an authorization token.

Specified by:
validateRequestForAuthCode in interface OAuth2Service
Throws:
OAuth2Exception

validateRequestForAccessToken

public void validateRequestForAccessToken(OAuth2NormalizedRequest req)
                                   throws OAuth2Exception
Description copied from interface: OAuth2Service
Validates a client's request for an access token.

Specified by:
validateRequestForAccessToken in interface OAuth2Service
Throws:
OAuth2Exception

validateRequestForResource

public void validateRequestForResource(OAuth2NormalizedRequest req,
                                       java.lang.Object resourceRequest)
                                throws OAuth2Exception
Description copied from interface: OAuth2Service
Validates a client's request to use access a resource.

Specified by:
validateRequestForResource in interface OAuth2Service
Throws:
OAuth2Exception

grantAuthorizationCode

public OAuth2Code grantAuthorizationCode(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Grants an authorization code to the given client by generating and registering the code.

Specified by:
grantAuthorizationCode in interface OAuth2Service

grantAccessToken

public OAuth2Code grantAccessToken(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Grants an access token to the given client by generating and registering the access token.

Specified by:
grantAccessToken in interface OAuth2Service

grantRefreshToken

public OAuth2Code grantRefreshToken(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Grants a refresh token to the given client by generating and registering the refresh token.

Specified by:
grantRefreshToken in interface OAuth2Service

generateAuthorizationCode

public OAuth2Code generateAuthorizationCode(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Generates an authorization code from a client OAuth 2.0 request.

Specified by:
generateAuthorizationCode in interface OAuth2Service

generateAccessToken

public OAuth2Code generateAccessToken(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Generates an access token from a client OAuth 2.0 request.

Specified by:
generateAccessToken in interface OAuth2Service

generateRefreshToken

public OAuth2Code generateRefreshToken(OAuth2NormalizedRequest req)
Description copied from interface: OAuth2Service
Generates a refresh token from a client OAuth 2.0 request.

Specified by:
generateRefreshToken in interface OAuth2Service


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.