usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [2/2] incubator-usergrid git commit: SSO central related: remove redundant calls to activate organization, and avoid NPEs in ensureAuthenticationAllowed().
Date Wed, 29 Apr 2015 19:19:54 GMT
SSO central related: remove redundant calls to activate organization, and avoid NPEs in ensureAuthenticationAllowed().


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8d749ca6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8d749ca6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8d749ca6

Branch: refs/heads/master
Commit: 8d749ca6ef6df30438d8d5541370b6c3aca8d0b0
Parents: 2775149
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Wed Apr 29 10:54:37 2015 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Wed Apr 29 10:54:37 2015 -0400

----------------------------------------------------------------------
 .../apache/usergrid/rest/management/ManagementResource.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8d749ca6/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
index fcbf49c..6a0f4f2 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
@@ -606,7 +606,6 @@ public class ManagementResource extends AbstractContextResource {
                         OrganizationOwnerInfo ownerOrgInfo = management.createOwnerAndOrganization(
                                 orgName, username, name, email, dummyPassword, true, false
);
 
-                        management.activateOrganization( ownerOrgInfo.getOrganization() );
// redundant?
                         applicationCreator.createSampleFor( ownerOrgInfo.getOrganization()
);
 
                         userId = ownerOrgInfo.getOwner().getUuid();
@@ -623,8 +622,6 @@ public class ManagementResource extends AbstractContextResource {
                         // already created user, so just create an org
                         final OrganizationInfo organization = management.createOrganization(
orgName, userInfo, true );
 
-
-                        management.activateOrganization( organization ); // redundant?
                         applicationCreator.createSampleFor( organization );
 
                         logger.info( "Created user {}'s other org {}", username, orgName
);
@@ -710,6 +707,10 @@ public class ManagementResource extends AbstractContextResource {
      */
     private void ensureAuthenticationAllowed( String username, String grant_type ) {
 
+        if ( username == null || grant_type == null || !grant_type.equalsIgnoreCase( "password"
)) {
+            return; // we only care about username/password auth
+        }
+
         final boolean externalTokensEnabled =
                 !StringUtils.isEmpty( properties.getProperty( USERGRID_CENTRAL_URL ) );
 


Mime
View raw message