Skip to content

Commit

Permalink
oxcore : added ResourceOwnerPasswordCredentialType custom interface d…
Browse files Browse the repository at this point in the history
…efinition for RS PC interception.

GluuFederation/oxAuth#230
  • Loading branch information
yuriyz committed Dec 21, 2018
1 parent 06ca29d commit 646e94d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Expand Up @@ -20,6 +20,8 @@
import org.xdi.model.custom.script.type.id.IdGeneratorType;
import org.xdi.model.custom.script.type.introspection.DummyIntrospectionType;
import org.xdi.model.custom.script.type.introspection.IntrospectionType;
import org.xdi.model.custom.script.type.owner.DummyResourceOwnerPasswordCredentialsType;
import org.xdi.model.custom.script.type.owner.ResourceOwnerPasswordCredentialsType;
import org.xdi.model.custom.script.type.scim.DummyScimType;
import org.xdi.model.custom.script.type.scim.ScimType;
import org.xdi.model.custom.script.type.scope.DummyDynamicScopeType;
Expand All @@ -44,6 +46,7 @@ public enum CustomScriptType implements LdapEnum {

PERSON_AUTHENTICATION("person_authentication", "Person Authentication", PersonAuthenticationType.class, AuthenticationCustomScript.class, "PersonAuthentication", new DummyPersonAuthenticationType()),
INTROSPECTION("introspection", "Introspection", IntrospectionType.class, CustomScript.class, "Introspection", new DummyIntrospectionType()),
RESOURCE_OWNER_PASSWORD_CREDENTIALS("resource_owner_password_credentials", "Resource Owner Password Credentials", ResourceOwnerPasswordCredentialsType.class, CustomScript.class, "ResourceOwnerPasswordCredentials", new DummyResourceOwnerPasswordCredentialsType()),
APPLICATION_SESSION("application_session", "Application Session", ApplicationSessionType.class, CustomScript.class, "ApplicationSession", new DummyApplicationSessionType()),
CACHE_REFRESH("cache_refresh", "Cache Refresh", CacheRefreshType.class, CustomScript.class, "CacheRefresh", new DummyCacheRefreshType()),
UPDATE_USER("update_user", "Update User", UpdateUserType.class, CustomScript.class, "UpdateUser", new DummyUpdateUserType()),
Expand Down
@@ -0,0 +1,30 @@
package org.xdi.model.custom.script.type.owner;

import org.xdi.model.SimpleCustomProperty;

import java.util.Map;

/**
* @author Yuriy Zabrovarnyy
*/
public class DummyResourceOwnerPasswordCredentialsType implements ResourceOwnerPasswordCredentialsType {
@Override
public boolean init(Map<String, SimpleCustomProperty> configurationAttributes) {
return true;
}

@Override
public boolean destroy(Map<String, SimpleCustomProperty> configurationAttributes) {
return true;
}

@Override
public int getApiVersion() {
return 1;
}

@Override
public boolean authenticate(Object context) {
return false;
}
}
@@ -0,0 +1,11 @@
package org.xdi.model.custom.script.type.owner;

import org.xdi.model.custom.script.type.BaseExternalType;

/**
* @author Yuriy Zabrovarnyy
*/
public interface ResourceOwnerPasswordCredentialsType extends BaseExternalType {

boolean authenticate(Object context);
}

0 comments on commit 646e94d

Please sign in to comment.