Search in sources :

Example 6 with UserResource

use of com.unboundid.scim2.common.types.UserResource in project cas by apereo.

the class ScimV2PrincipalProvisioner method createUserResource.

/**
 * Create user resource boolean.
 *
 * @param principal         the principal
 * @param credential        the credential
 * @param registeredService the registered service
 * @return true /false
 * @throws Exception the exception
 */
protected boolean createUserResource(final Principal principal, final Credential credential, final Optional<RegisteredService> registeredService) throws Exception {
    val user = new UserResource();
    mapper.map(user, principal, credential);
    LOGGER.trace("Creating user resource [{}]", user);
    return getScimService(registeredService).create("Users", user) != null;
}
Also used : lombok.val(lombok.val) UserResource(com.unboundid.scim2.common.types.UserResource)

Aggregations

Name (com.unboundid.scim2.common.types.Name)4 UserResource (com.unboundid.scim2.common.types.UserResource)4 lombok.val (lombok.val)4 Meta (com.unboundid.scim2.common.types.Meta)3 Email (com.unboundid.scim2.common.types.Email)2 PhoneNumber (com.unboundid.scim2.common.types.PhoneNumber)2 URI (java.net.URI)2 Test (org.junit.jupiter.api.Test)2 UsernamePasswordCredential (org.apereo.cas.authentication.credential.UsernamePasswordCredential)1 MockWebServer (org.apereo.cas.util.MockWebServer)1 Executable (org.junit.jupiter.api.function.Executable)1 ByteArrayResource (org.springframework.core.io.ByteArrayResource)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)1 MockServletContext (org.springframework.mock.web.MockServletContext)1 ServletExternalContext (org.springframework.webflow.context.servlet.ServletExternalContext)1 MockRequestContext (org.springframework.webflow.test.MockRequestContext)1