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
 AuthorizationRequestHolder consumeAuthorizationCode(String code)
          Consume a authorization code.
 String createAuthorizationCode(AuthorizationRequestHolder authentication)
          Create a authorization code for the specified authentications.
protected abstract  AuthorizationRequestHolder remove(String code)
           
protected abstract  void store(String code, AuthorizationRequestHolder 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,
                              AuthorizationRequestHolder authentication)

remove

protected abstract AuthorizationRequestHolder remove(String code)

createAuthorizationCode

public String createAuthorizationCode(AuthorizationRequestHolder 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 AuthorizationRequestHolder 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 © 2012. All Rights Reserved.