Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 1d9625605 -> 742cb68a9
[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/742cb68a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/742cb68a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/742cb68a Branch: refs/heads/3.1.x-fixes Commit: 742cb68a9172c968aeea5ece7146f9c3dfacde9a Parents: 1d96256 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:29:43 2017 +0000 ---------------------------------------------------------------------- .../oauth2/grants/owner/JAASResourceOwnerLoginHandler.java | 7 ++++--- .../oauth2/grants/owner/ResourceOwnerGrantHandler.java | 2 +- .../oauth2/grants/owner/ResourceOwnerLoginHandler.java | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/742cb68a/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 7eb7bfc..b89ad7e 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; @@ -29,9 +30,9 @@ import org.apache.cxf.security.SecurityContext; 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/742cb68a/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 4a5d03b..b84ca30 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/742cb68a/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 8d63d69..aded593 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); }