org.springframework.security.oauth2.provider.endpoint
Class DefaultRedirectResolver

java.lang.Object
  extended by org.springframework.security.oauth2.provider.endpoint.DefaultRedirectResolver
All Implemented Interfaces:
RedirectResolver
Direct Known Subclasses:
ExactMatchRedirectResolver

public class DefaultRedirectResolver
extends Object
implements RedirectResolver

Default implementation for a redirect resolver.

Author:
Ryan Heaton, Dave Syer

Constructor Summary
DefaultRedirectResolver()
           
 
Method Summary
protected  boolean redirectMatches(String requestedRedirect, String redirectUri)
          Whether the requested redirect URI "matches" the specified redirect URI.
 String resolveRedirect(String requestedRedirect, ClientDetails client)
          Resolve the redirect for the specified client.
 void setRedirectGrantTypes(Collection<String> redirectGrantTypes)
          Grant types that are permitted to have a redirect uri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRedirectResolver

public DefaultRedirectResolver()
Method Detail

setRedirectGrantTypes

public void setRedirectGrantTypes(Collection<String> redirectGrantTypes)
Grant types that are permitted to have a redirect uri.

Parameters:
redirectGrantTypes - the redirect grant types to set

resolveRedirect

public String resolveRedirect(String requestedRedirect,
                              ClientDetails client)
                       throws OAuth2Exception
Description copied from interface: RedirectResolver
Resolve the redirect for the specified client.

Specified by:
resolveRedirect in interface RedirectResolver
Parameters:
requestedRedirect - The redirect that was requested (may not be null).
client - The client for which we're resolving the redirect.
Returns:
The resolved redirect URI.
Throws:
OAuth2Exception - If the requested redirect is invalid for the specified client.

redirectMatches

protected boolean redirectMatches(String requestedRedirect,
                                  String redirectUri)
Whether the requested redirect URI "matches" the specified redirect URI. This implementation tests if the user requrested redirect starts with the registered redirect, so it would have the same host and root path if it is an HTTP URL.

Parameters:
requestedRedirect - The requested redirect URI.
redirectUri - The registered redirect URI.
Returns:
Whether the requested redirect URI "matches" the specified redirect URI.


Copyright © 2012. All Rights Reserved.