org.springframework.security.oauth2.provider.code
Class RandomValueAuthorizationCodeServices

java.lang.Object
  extended by org.springframework.security.oauth2.provider.code.RandomValueAuthorizationCodeServices
All Implemented Interfaces:
AuthorizationCodeServices
Direct Known Subclasses:
InMemoryAuthorizationCodeServices, JdbcAuthorizationCodeServices

public abstract class RandomValueAuthorizationCodeServices
extends Object
implements AuthorizationCodeServices

Base implementation for authorization code services that generates a random-value authorization code.

Author:
Ryan Heaton, Dave Syer

Constructor Summary
RandomValueAuthorizationCodeServices()
           
 
Method Summary
 OAuth2Authentication consumeAuthorizationCode(String code)
          Consume a authorization code.
 String createAuthorizationCode(OAuth2Authentication authentication)
          Create a authorization code for the specified authentications.
protected abstract  OAuth2Authentication remove(String code)
           
protected abstract  void store(String code, OAuth2Authentication authentication)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomValueAuthorizationCodeServices

public RandomValueAuthorizationCodeServices()
Method Detail

store

protected abstract void store(String code,
                              OAuth2Authentication authentication)

remove

protected abstract OAuth2Authentication remove(String code)

createAuthorizationCode

public String createAuthorizationCode(OAuth2Authentication authentication)
Description copied from interface: AuthorizationCodeServices
Create a authorization code for the specified authentications.

Specified by:
createAuthorizationCode in interface AuthorizationCodeServices
Parameters:
authentication - The authentications to store.
Returns:
The generated code.

consumeAuthorizationCode

public OAuth2Authentication consumeAuthorizationCode(String code)
                                              throws InvalidGrantException
Description copied from interface: AuthorizationCodeServices
Consume a authorization code.

Specified by:
consumeAuthorizationCode in interface AuthorizationCodeServices
Parameters:
code - The authorization code to consume.
Returns:
The authentications associated with the code.
Throws:
InvalidGrantException - If the authorization code is invalid or expired.


Copyright © 2013. All rights reserved.