You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/02/02 15:55:25 UTC

svn commit: r1728141 - /qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java

Author: orudyy
Date: Tue Feb  2 14:55:25 2016
New Revision: 1728141

URL: http://svn.apache.org/viewvc?rev=1728141&view=rev
Log:
QPID-6965: Fix compilation issue after merging done under revision 1727958 on 6.0.x

Modified:
    qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java

Modified: qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java?rev=1728141&r1=1728140&r2=1728141&view=diff
==============================================================================
--- qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java (original)
+++ qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java Tue Feb  2 14:55:25 2016
@@ -37,6 +37,7 @@ import org.apache.qpid.server.model.Grou
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
 import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
+import org.apache.qpid.server.security.auth.manager.UsernamePasswordAuthenticationProvider;
 
 /**
  * Creates a {@link Subject} formed by the {@link Principal}'s returned from:
@@ -125,6 +126,16 @@ public class SubjectCreator
         }
     }
 
+    public SubjectAuthenticationResult authenticate(String username, String password)
+    {
+        if (_authenticationProvider instanceof UsernamePasswordAuthenticationProvider)
+        {
+            final AuthenticationResult authenticationResult = ((UsernamePasswordAuthenticationProvider)_authenticationProvider).authenticate(username, password);
+            return createResultWithGroups(username, authenticationResult);
+        }
+        return new SubjectAuthenticationResult(new AuthenticationResult(AuthenticationStatus.ERROR));
+    }
+
     public SubjectAuthenticationResult createResultWithGroups(String username, final AuthenticationResult authenticationResult)
     {
         if(authenticationResult.getStatus() == AuthenticationStatus.SUCCESS)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org