for users with SSO2 enabled, the admin users cannot reset the password.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6e093bc0 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6e093bc0 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6e093bc0 Branch: refs/heads/master Commit: 6e093bc0b156c371a461440784180cf0c5487118 Parents: d393445 Author: Ayesha Dastagiri <ayesha.am...@gmail.com> Authored: Tue Jul 12 11:40:18 2016 -0700 Committer: Ayesha Dastagiri <ayesha.am...@gmail.com> Committed: Tue Jul 12 11:40:18 2016 -0700 ---------------------------------------------------------------------- .../usergrid/rest/management/users/UserResource.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/6e093bc0/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java ---------------------------------------------------------------------- diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java index f568463..c66822c 100644 --- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java +++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java @@ -136,6 +136,11 @@ public class UserResource extends AbstractContextResource { @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback ) throws Exception { + if ( tokens.isExternalSSOProviderEnabled() ) { + throw new IllegalArgumentException( "Admin Users must reset passwords via " + + properties.getProperty( USERGRID_EXTERNAL_PROVIDER_URL ) ); + } + if ( json == null ) { return null; } @@ -474,6 +479,11 @@ public class UserResource extends AbstractContextResource { @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback, @QueryParam( "token" ) String token ) throws Exception { + if ( tokens.isExternalSSOProviderEnabled() ) { + throw new IllegalArgumentException( "Admin Users must tokens must be revoked via " + + properties.getProperty( USERGRID_EXTERNAL_PROVIDER_URL ) ); + } + UUID adminId = user.getUuid(); this.token = token;