Author: sergeyb
Date: Fri Mar 30 16:38:00 2012
New Revision: 1307520
URL: http://svn.apache.org/viewvc?rev=1307520&view=rev
Log:
Starting to fix OAuth2 module Java docs, more to come
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessToken.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenGrant.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenRegistration.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Client.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthContext.java
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
Fri Mar 30 16:38:00 2012
@@ -39,8 +39,7 @@ import org.apache.cxf.rs.security.oauth2
import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
/**
- * The utility class for simplifying making OAuth request and access token
- * requests as well as for creating Authorization OAuth headers
+ * The utility class for simplifying working with OAuth servers
*/
public final class OAuthClientUtils {
private OAuthClientUtils() {
@@ -48,11 +47,15 @@ public final class OAuthClientUtils {
}
/**
- * Returns URI of the authorization service with the query parameter
containing
- * the request token key
- * @param authorizationServiceURI the service URI
- * @param requestToken the request token key
- * @return
+ * Builds a complete URI for redirecting to OAuth Authorization Service
+ * @param authorizationServiceURI the service endpoint address
+ * @param clientId client registration id
+ * @param redirectUri the uri the authorization code will be posted to
+ * @param state the client state, example the key or the encrypted token
+ * representing the info about the current end user's request
+ * @scope scope the optional scope; if not specified then the authorization
+ * service will allocate the default scope
+ * @return authorization service URI
*/
public static URI getAuthorizationURI(String authorizationServiceURI,
String clientId,
@@ -71,6 +74,14 @@ public final class OAuthClientUtils {
return ub.build();
}
+ /**
+ * Creates the builder for building OAuth AuthorizationService URIs
+ * @param authorizationServiceURI the service endpoint address
+ * @param clientId client registration id
+ * @param scope the optional scope; if not specified then the authorization
+ * service will allocate the default scope
+ * @return the builder
+ */
public static UriBuilder getAuthorizationURIBuilder(String
authorizationServiceURI,
String clientId,
String scope) {
@@ -85,6 +96,15 @@ public final class OAuthClientUtils {
return ub;
}
+ /**
+ * Obtains the access token from OAuth AccessToken Service
+ * using the initialized web client
+ * @param accessTokenService the AccessToken client
+ * @param consumer {@link Consumer} representing the registered client
+ * @param grant {@link AccessTokenGrant} grant
+ * @return {@link ClientAccessToken} access token
+ * @throws OAuthServiceException
+ */
public static ClientAccessToken getAccessToken(WebClient
accessTokenService,
Consumer consumer,
AccessTokenGrant grant)
throws OAuthServiceException {
@@ -92,6 +112,17 @@ public final class OAuthClientUtils {
return getAccessToken(accessTokenService, consumer, grant, true);
}
+ /**
+ * Obtains the access token from OAuth AccessToken Service
+ * @param accessTokenServiceUri the AccessToken endpoint address
+ * @param consumer {@link Consumer} representing the registered client
+ * @param grant {@link AccessTokenGrant} grant
+ * @param setAuthorizationHeader if set to true then HTTP Basic scheme
+ * will be used to pass client id and secret, otherwise they will
+ * be passed in the form payload
+ * @return {@link ClientAccessToken} access token
+ * @throws OAuthServiceException
+ */
public static ClientAccessToken getAccessToken(String
accessTokenServiceUri,
Consumer consumer,
AccessTokenGrant grant,
@@ -104,6 +135,18 @@ public final class OAuthClientUtils {
return getAccessToken(accessTokenService, consumer, grant, true);
}
+ /**
+ * Obtains the access token from OAuth AccessToken Service
+ * using the initialized web client
+ * @param accessTokenService the AccessToken client
+ * @param consumer {@link Consumer} representing the registered client.
+ * @param grant {@link AccessTokenGrant} grant
+ * @param setAuthorizationHeader if set to true then HTTP Basic scheme
+ * will be used to pass client id and secret, otherwise they will
+ * be passed in the form payload
+ * @return {@link ClientAccessToken} access token
+ * @throws OAuthServiceException
+ */
public static ClientAccessToken getAccessToken(WebClient
accessTokenService,
Consumer consumer,
AccessTokenGrant grant,
@@ -111,20 +154,25 @@ public final class OAuthClientUtils {
throws OAuthServiceException {
Form form = new Form(grant.toMap());
-
- if (setAuthorizationHeader) {
- StringBuilder sb = new StringBuilder();
- sb.append("Basic ");
- try {
- String data = consumer.getKey() + ":" + consumer.getSecret();
- sb.append(Base64Utility.encode(data.getBytes("UTF-8")));
- } catch (Exception ex) {
- throw new ClientWebApplicationException(ex);
+
+ if (consumer != null) {
+ if (setAuthorizationHeader) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Basic ");
+ try {
+ String data = consumer.getKey() + ":" +
consumer.getSecret();
+ sb.append(Base64Utility.encode(data.getBytes("UTF-8")));
+ } catch (Exception ex) {
+ throw new ClientWebApplicationException(ex);
+ }
+ accessTokenService.header("Authorization", sb.toString());
+ } else {
+ form.set(OAuthConstants.CLIENT_ID, consumer.getKey());
+ form.set(OAuthConstants.CLIENT_SECRET, consumer.getSecret());
}
- accessTokenService.header("Authorization", sb.toString());
} else {
- form.set(OAuthConstants.CLIENT_ID, consumer.getKey());
- form.set(OAuthConstants.CLIENT_SECRET, consumer.getSecret());
+ // in this case the AccessToken service is expected to find a
mapping between
+ // the authenticated credentials and the client registration id
}
Response response = accessTokenService.form(form);
Map<String, String> map = null;
@@ -154,7 +202,9 @@ public final class OAuthClientUtils {
}
/**
- * Creates OAuth Authorization header
+ * Creates OAuth Authorization header for accessing the end user's
resources
+ * @param consumer represents the registered client
+ * @param accessToken the access token
* @return the header value
*/
public static String createAuthorizationHeader(Consumer consumer,
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessToken.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessToken.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessToken.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessToken.java
Fri Mar 30 16:38:00 2012
@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.Map;
/**
- * Base Token representation
+ * Base Access Token representation
*/
public abstract class AccessToken {
@@ -35,6 +35,10 @@ public abstract class AccessToken {
this.tokenKey = tokenKey;
}
+ /**
+ * Returns the token type such as bearer, mac, etc
+ * @return the type
+ */
public String getTokenType() {
return tokenType;
}
@@ -47,10 +51,18 @@ public abstract class AccessToken {
return tokenKey;
}
+ /**
+ * Sets token parameters
+ * @param parameters the token parameters
+ */
public void setParameters(Map<String, String> parameters) {
this.parameters = parameters;
}
+ /**
+ * Gets token parameters
+ * @return
+ */
public Map<String, String> getParameters() {
return parameters;
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenGrant.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenGrant.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenGrant.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenGrant.java
Fri Mar 30 16:38:00 2012
@@ -20,7 +20,21 @@ package org.apache.cxf.rs.security.oauth
import javax.ws.rs.core.MultivaluedMap;
+/**
+ * Access Token Grant
+ */
public interface AccessTokenGrant {
+ /**
+ * Returns the token grant type, example, "authorization_code"
+ * @return
+ */
String getType();
+
+ /**
+ * Returns the map containing public grant parameters;
+ * can be used by clients requesting the access tokens.
+ *
+ * @return the grant parameters
+ */
MultivaluedMap<String, String> toMap();
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenRegistration.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenRegistration.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenRegistration.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AccessTokenRegistration.java
Fri Mar 30 16:38:00 2012
@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.List;
/**
- * Captures the information associated with the code grant registration
request.
+ * Captures the information associated with the access token request.
*/
public class AccessTokenRegistration {
private Client client;
@@ -31,35 +31,85 @@ public class AccessTokenRegistration {
private String grantType;
private UserSubject subject;
+ /**
+ * Sets the {@link Client} instance
+ * @param client the client
+ */
public void setClient(Client client) {
this.client = client;
}
+
+ /**
+ * Returns the {@link Client} instance
+ * @return the client.
+ */
public Client getClient() {
return client;
}
-
+
+ /**
+ * Sets the requested scope
+ * @param requestedScope the scope
+ */
public void setRequestedScope(List<String> requestedScope) {
this.requestedScope = requestedScope;
}
+
+ /**
+ * Gets the requested scope
+ * @return the scope
+ */
public List<String> getRequestedScope() {
return requestedScope;
}
+
+ /**
+ * Sets the scope explicitly approved by the end user
+ * @param approvedScope the approved scope
+ */
+ public void setApprovedScope(List<String> approvedScope) {
+ this.approvedScope = approvedScope;
+ }
+
+ /**
+ * Gets the scope explicitly approved by the end user
+ * @return the scope
+ */
+ public List<String> getApprovedScope() {
+ return approvedScope;
+ }
+
+ /**
+ * Sets the {@link UserSubject) instance capturing
+ * the information about the end user
+ * @param subject the end user subject
+ */
public void setSubject(UserSubject subject) {
this.subject = subject;
}
+
+ /**
+ * Gets the {@link UserSubject) instance capturing
+ * the information about the end user
+ * @return the subject
+ */
public UserSubject getSubject() {
return subject;
}
+
+ /**
+ * Sets the type of grant which is exchanged for this token
+ * @param grantType the grant type
+ */
public void setGrantType(String grantType) {
this.grantType = grantType;
}
+ /**
+ * Gets the type of grant which is exchanged for this token
+ * @return the grant type
+ */
public String getGrantType() {
return grantType;
}
- public void setApprovedScope(List<String> approvedScope) {
- this.approvedScope = approvedScope;
- }
- public List<String> getApprovedScope() {
- return approvedScope;
- }
+
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Client.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Client.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Client.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Client.java
Fri Mar 30 16:38:00 2012
@@ -60,7 +60,7 @@ public class Client {
}
/**
- * Gets the consumer registration id
+ * Gets the client registration id
* @return the consumer key
*/
public String getClientId() {
@@ -68,8 +68,8 @@ public class Client {
}
/**
- * Gets the secret key
- * @return the secret key
+ * Gets the client secret
+ * @return the secret
*/
public String getClientSecret() {
return clientSecret;
@@ -95,8 +95,6 @@ public class Client {
/**
* Gets the public URI of the third-party application.
- * For example, this property can be used to validate
- * request token callbacks
* @return the application URI
*/
public String getApplicationWebUri() {
@@ -105,6 +103,7 @@ public class Client {
/**
* Sets the public URI of the third-party application.
+ * @param applicationWebUri the application URI
*/
public void setApplicationWebUri(String applicationWebUri) {
this.applicationWebUri = applicationWebUri;
@@ -112,6 +111,7 @@ public class Client {
/**
* Sets the description of the third-party application.
+ * @param applicationDescription the description
*/
public void setApplicationDescription(String applicationDescription) {
this.applicationDescription = applicationDescription;
@@ -126,46 +126,91 @@ public class Client {
}
/**
- * Sets the uri pointing to a client logo image.
- * At the moment it must be a relative URI
- * @param logoPath
+ * Sets the URI pointing to a logo image of the client application
+ * @param logoPath the logo URI
*/
public void setApplicationLogoUri(String logoPath) {
this.applicationLogoUri = logoPath;
}
+ /**
+ * Get the URI pointing to a logo image of the client application
+ * @return the logo URI
+ */
public String getApplicationLogoUri() {
return applicationLogoUri;
}
+ /**
+ * Sets the confidentiality status of this client application.
+ * This can be used to restrict which OAuth2 flows this client
+ * can participate in.
+ *
+ * @param isConf true if the client is confidential
+ */
public void setConfidential(boolean isConf) {
this.isConfidential = isConf;
}
+ /**
+ * Gets the confidentiality status of this client application.
+ * @return the confidentiality status
+ */
public boolean isConfidential() {
return isConfidential;
}
+ /**
+ * Sets a list of URIs the AuthorizationService
+ * may return the authorization code to.
+ * @param redirectUris the redirect uris
+ */
public void setRedirectUris(List<String> redirectUris) {
this.redirectUris = redirectUris;
}
+ /**
+ * Gets a list of URIs the AuthorizationService
+ * may return the authorization code to
+ * @return the redirect uris
+ */
public List<String> getRedirectUris() {
return redirectUris;
}
+ /**
+ * Sets the list of access token grant types this client
+ * can use to obtain the access tokens.
+ * @param allowedGrantTypes the list of grant types
+ */
public void setAllowedGrantTypes(List<String> allowedGrantTypes) {
this.allowedGrantTypes = allowedGrantTypes;
}
+ /**
+ * Gets the list of access token grant types this client
+ * can use to obtain the access tokens.
+ * @return the list of grant types
+ */
public List<String> getAllowedGrantTypes() {
return allowedGrantTypes;
}
+ /**
+ * Sets the {@link UserSubject} representing this Client
+ * authentication, may be setup during the registration.
+ *
+ * @param subject the user subject
+ */
public void setSubject(UserSubject subject) {
this.subject = subject;
}
+ /**
+ * Gets the {@link UserSubject} representing this Client
+ * authentication
+ * @return the user subject
+ */
public UserSubject getSubject() {
return subject;
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java
Fri Mar 30 16:38:00 2012
@@ -21,7 +21,10 @@ package org.apache.cxf.rs.security.oauth
/**
- * Base Token representation
+ * Represents the extended client view of {@link AccessToken}.
+ * It may contain the actual scope value assigned to the access token,
+ * the refresh token key, and other properties such as when this token
+ * will expire, etc.
*/
public class ClientAccessToken extends AccessToken {
@@ -32,18 +35,38 @@ public class ClientAccessToken extends A
super(tokenType, tokenKey);
}
+ /**
+ * Sets the actual scope assigned to the access token.
+ * For example, it can be down-scoped in which case the client
+ * may need to adjust the way it works with the end user.
+ * @param approvedScope the actual scope
+ */
public void setApprovedScope(String approvedScope) {
this.scope = approvedScope;
}
+ /**
+ * Gets the actual scope assigned to the access token.
+ * @return the scope
+ */
public String getApprovedScope() {
return scope;
}
+ /**
+ * Sets the refresh token key the client can use to obtain a new
+ * access token
+ * @param refreshToken the refresh token
+ */
public void setRefreshToken(String refreshToken) {
this.rToken = refreshToken;
}
+ /**
+ * Gets the refresh token key the client can use to obtain a new
+ * access token
+ * @return the refresh token
+ */
public String getRefreshToken() {
return rToken;
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
Fri Mar 30 16:38:00 2012
@@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlRoot
/**
* This bean represents a resource owner authorization challenge.
* Typically, an HTML view will be returned to a resource owner who
- * will authorize or deny the third-party consumer
+ * will authorize or deny the third-party client
*/
@XmlRootElement(name = "authorizationData",
namespace = "http://org.apache.cxf.rs.security.oauth")
@@ -50,90 +50,184 @@ public class OAuthAuthorizationData impl
public OAuthAuthorizationData() {
}
+ /**
+ * Sets the client application name
+ * @return application name
+ */
public String getApplicationName() {
return applicationName;
}
+ /**
+ * Sets the client application name
+ * @param applicationName application name
+ */
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
+ /**
+ * Gets the list of scopes translated to {@link Permission} instances
+ * requested by the client application
+ * @return the list of scopes
+ */
public List<? extends Permission> getPermissions() {
return permissions;
}
+ /**
+ * Gets the list of scopes translated to {@link Permission} instances
+ * @return the list of scopses
+ **/
public void setPermissions(List<? extends Permission> permissions) {
this.permissions = permissions;
}
+ /**
+ * Sets the authenticity token linking the authorization
+ * challenge to the current end user session
+ *
+ * @param authenticityToken the session authenticity token
+ */
public void setAuthenticityToken(String authenticityToken) {
this.authenticityToken = authenticityToken;
}
+ /**
+ * Gets the authenticity token linking the authorization
+ * challenge to the current end user session
+ * @return the session authenticity token
+ */
public String getAuthenticityToken() {
return authenticityToken;
}
+ /**
+ * Sets the application description
+ * @param applicationDescription the description
+ */
public void setApplicationDescription(String applicationDescription) {
this.applicationDescription = applicationDescription;
}
+ /**
+ * Gets the application description
+ * @return the description
+ */
public String getApplicationDescription() {
return applicationDescription;
}
+ /**
+ * Sets the client id which needs to be retained in a hidden form field
+ * @param clientId the client id
+ */
public void setClientId(String clientId) {
this.clientId = clientId;
}
+ /**
+ * Gets the client id which needs to be retained in a hidden form field
+ * @return the client id
+ */
public String getClientId() {
return clientId;
}
+ /**
+ * Sets the redirect uri which needs to be retained in a hidden form field
+ * @param redirectUri the redirect uri
+ */
public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}
+ /**
+ * Gets the redirect uri which needs to be retained in a hidden form field
+ * @return the redirect uri
+ */
public String getRedirectUri() {
return redirectUri;
}
+ /**
+ * Sets the client state token which needs to be retained in a hidden form
field
+ * @param state the state
+ */
public void setState(String state) {
this.state = state;
}
+ /**
+ * Gets the client state token which needs to be retained in a hidden form
field
+ * @return
+ */
public String getState() {
return state;
}
+ /**
+ * Sets the application web URI
+ * @param applicationWebUri the application URI
+ */
public void setApplicationWebUri(String applicationWebUri) {
this.applicationWebUri = applicationWebUri;
}
+ /**
+ * Gets the application web URI
+ * @return the application URI
+ */
public String getApplicationWebUri() {
return applicationWebUri;
}
+ /**
+ * Sets the application logo URI
+ * @param applicationLogoUri the logo URI
+ */
public void setApplicationLogoUri(String applicationLogoUri) {
this.applicationLogoUri = applicationLogoUri;
}
+ /**
+ * Gets the application logo URI
+ * @return the logo URI
+ */
public String getApplicationLogoUri() {
return applicationLogoUri;
}
+ /**
+ * Sets the requested scope which needs to be retained in a hidden form
field
+ * @param proposedScope the scope
+ */
public void setProposedScope(String proposedScope) {
this.proposedScope = proposedScope;
}
+ /**
+ * Gets the requested scope which needs to be retained in a hidden form
field
+ * @return the scope
+ */
public String getProposedScope() {
return proposedScope;
}
+ /**
+ * Sets the absolute URI where the authorization decision data
+ * will need to be sent to
+ * @param replyTo authorization decision handler URI
+ */
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
+ /**
+ * Gets the absolute URI where the authorization decision data
+ * will need to be sent to
+ * @return authorization decision handler URI
+ */
public String getReplyTo() {
return replyTo;
}
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthContext.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthContext.java?rev=1307520&r1=1307519&r2=1307520&view=diff
==============================================================================
---
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthContext.java
(original)
+++
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthContext.java
Fri Mar 30 16:38:00 2012
@@ -23,7 +23,8 @@ import java.util.List;
/**
- * Captures the information which custom filters may use to further protect
the endpoints
+ * Captures the information about the current client request
+ * which custom filters may use to further protect the endpoints
*/
public class OAuthContext {
@@ -38,15 +39,29 @@ public class OAuthContext {
this.permissions = perms;
this.tokenGrantType = tokenGrantType;
}
-
+
+ /**
+ * Gets the {@link UserSubject} representing the end user authorizing the
client
+ * at the authorization grant creation time
+ * @return the subject
+ */
public UserSubject getSubject() {
return subject;
}
+ /**
+ * Gets the list of the permissions assigned to the current access token
+ * @return the permissions
+ */
public List<OAuthPermission> getPermissions() {
return Collections.unmodifiableList(permissions);
}
+ /**
+ * Returns the grant type which was used to obtain the access token
+ * the client is using now during the current request
+ * @return the grant type
+ */
public String getTokenGrantType() {
return tokenGrantType;
}