public void create(Client client,OAuth2Request request) throws InvalidClientMetadata {
  Map<String,Set<String>> attrs=createClientAttributeMap(client);
  try {
    final SSOToken token=AccessController.doPrivileged(AdminTokenAction.getInstance());
    final String realm=request.getParameter(OAuth2Constants.Custom.REALM);
    AMIdentityRepository repo=idRepoFactory.create(realm,token);
    repo.createIdentity(IdType.AGENTONLY,client.getClientID(),attrs);
  }
 catch (  Exception e) {
    logger.error("ConnectClientRegistration.Validate(): Unable to create client",e);
    throw new InvalidClientMetadata();
  }
}

public void create ( Client client , OAuth2Request request ) throws InvalidClientMetadata { Map < String , Set < String > > attrs = createClientAttributeMap ( client ) ; try { final SSOToken token = AccessController . doPrivileged ( AdminTokenAction . getInstance ( ) ) ; final String realm = request . getParameter ( OAuth2Constants . Custom . REALM ) ; AMIdentityRepository repo = idRepoFactory . create ( realm , token ) ; repo . createIdentity ( IdType . AGENTONLY , client . getClientID ( ) , attrs ) ; } catch ( Exception e ) { logger . error ( "ConnectClientRegistration.Validate(): Unable to create client" , e ) ; throw new InvalidClientMetadata ( ) ; } }
stores a client to a storage system .
