Repository: cxf Updated Branches: refs/heads/master 0252de53c -> c7d50ca23
[CXF-7263] Updating ResourceOwnerLoginHandler to accept Client Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c7d50ca2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c7d50ca2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c7d50ca2 Branch: refs/heads/master Commit: c7d50ca238184789412737ea0f0db4b5b5503326 Parents: 0252de5 Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Thu Mar 2 22:26:51 2017 +0000 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Thu Mar 2 22:26:51 2017 +0000 ---------------------------------------------------------------------- .../oauth2/grants/owner/JAASResourceOwnerLoginHandler.java | 3 ++- .../oauth2/grants/owner/ResourceOwnerGrantHandler.java | 2 +- .../oauth2/grants/owner/ResourceOwnerLoginHandler.java | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c7d50ca2/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/JAASResourceOwnerLoginHandler.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/JAASResourceOwnerLoginHandler.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/JAASResourceOwnerLoginHandler.java index 480e2db..2af9212 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/JAASResourceOwnerLoginHandler.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/JAASResourceOwnerLoginHandler.java @@ -22,6 +22,7 @@ import org.apache.cxf.configuration.security.AuthorizationPolicy; import org.apache.cxf.interceptor.security.JAASLoginInterceptor; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageImpl; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.common.UserSubject; import org.apache.cxf.rs.security.oauth2.utils.OAuthUtils; import org.apache.cxf.security.SecurityContext; @@ -31,7 +32,7 @@ public class JAASResourceOwnerLoginHandler implements ResourceOwnerLoginHandler private JAASLoginInterceptor jaasInterceptor = new JAASLoginInterceptor(); - public UserSubject createSubject(String name, String password) { + public UserSubject createSubject(Client client, String name, String password) { Message message = setupMessage(name, password); jaasInterceptor.handleMessage(message); http://git-wip-us.apache.org/repos/asf/cxf/blob/c7d50ca2/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java index 5aba67e..a5f4538 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java @@ -49,7 +49,7 @@ public class ResourceOwnerGrantHandler extends AbstractGrantHandler { throw new OAuthServiceException( new OAuthError(OAuthConstants.INVALID_REQUEST)); } - UserSubject subject = loginHandler.createSubject(ownerName, ownerPassword); + UserSubject subject = loginHandler.createSubject(client, ownerName, ownerPassword); if (subject == null) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); } http://git-wip-us.apache.org/repos/asf/cxf/blob/c7d50ca2/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerLoginHandler.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerLoginHandler.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerLoginHandler.java index 937ed8b..dda599e 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerLoginHandler.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerLoginHandler.java @@ -18,6 +18,7 @@ */ package org.apache.cxf.rs.security.oauth2.grants.owner; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.common.UserSubject; public interface ResourceOwnerLoginHandler { @@ -25,9 +26,10 @@ public interface ResourceOwnerLoginHandler { /** * Create a {@link UserSubject} for the name and password parameters, or return null if the name and password * are invalid. - * @param name - * @param password + * @param client using the resource owner grant + * @param resource owner name + * @param resource owner password * @return A {@link UserSubject} representing the user, or null. */ - UserSubject createSubject(String name, String password); + UserSubject createSubject(Client client, String name, String password); }