Package org.gluu.oxauth.service
Class ClientService
- java.lang.Object
-
- org.gluu.oxauth.service.ClientService
-
@ApplicationScoped public class ClientService extends java.lang.Object
Provides operations with clients.- Version:
- October 22, 2016
- Author:
- Javier Rojas Blum, Yuriy Movchan Date: 04/15/2014
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
CLIENT_OBJECT_CLASSES
-
Constructor Summary
Constructors Constructor Description ClientService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(java.lang.String clientId, java.lang.String password)
Authenticate client.java.lang.String
buildClientDn(java.lang.String p_clientId)
java.lang.String
decryptSecret(java.lang.String encryptedClientSecret)
java.lang.String
encryptSecret(java.lang.String clientSecret)
java.util.List<Client>
getAllClients(java.lang.String[] returnAttributes)
java.util.List<Client>
getAllClients(java.lang.String[] returnAttributes, int size)
java.lang.Object
getAttribute(Client client, java.lang.String clientAttribute)
Client
getClient(java.lang.String clientId)
Client
getClient(java.lang.String clientId, java.lang.String registrationAccessToken)
java.util.Set<Client>
getClient(java.util.Collection<java.lang.String> clientIds, boolean silent)
Client
getClientByDn(java.lang.String dn)
Returns client by DN.java.util.Set<Client>
getClientsByDns(java.util.Collection<java.lang.String> dnList)
java.util.Set<Client>
getClientsByDns(java.util.Collection<java.lang.String> dnList, boolean silently)
org.gluu.persist.model.base.CustomAttribute
getCustomAttribute(Client client, java.lang.String attributeName)
boolean
isPublic(java.lang.String clientId)
boolean
isPublic(Client client)
void
merge(Client client)
void
persist(Client client)
void
remove(Client client)
void
setCustomAttribute(Client client, java.lang.String attributeName, java.lang.String attributeValue)
void
updateAccessTime(Client client, boolean isUpdateLogonTime)
-
-
-
Method Detail
-
persist
public void persist(Client client)
-
merge
public void merge(Client client)
-
authenticate
public boolean authenticate(java.lang.String clientId, java.lang.String password)
Authenticate client.- Parameters:
clientId
- Client inum.password
- Client password.- Returns:
true
if success, otherwisefalse
.
-
getClient
public java.util.Set<Client> getClient(java.util.Collection<java.lang.String> clientIds, boolean silent)
-
getClient
public Client getClient(java.lang.String clientId)
-
isPublic
public boolean isPublic(java.lang.String clientId)
-
isPublic
public boolean isPublic(Client client)
-
getClient
public Client getClient(java.lang.String clientId, java.lang.String registrationAccessToken)
-
getClientsByDns
public java.util.Set<Client> getClientsByDns(java.util.Collection<java.lang.String> dnList)
-
getClientsByDns
public java.util.Set<Client> getClientsByDns(java.util.Collection<java.lang.String> dnList, boolean silently)
-
getClientByDn
public Client getClientByDn(java.lang.String dn)
Returns client by DN.- Parameters:
dn
- dn of client- Returns:
- Client
-
getCustomAttribute
public org.gluu.persist.model.base.CustomAttribute getCustomAttribute(Client client, java.lang.String attributeName)
-
setCustomAttribute
public void setCustomAttribute(Client client, java.lang.String attributeName, java.lang.String attributeValue)
-
getAllClients
public java.util.List<Client> getAllClients(java.lang.String[] returnAttributes)
-
getAllClients
public java.util.List<Client> getAllClients(java.lang.String[] returnAttributes, int size)
-
buildClientDn
public java.lang.String buildClientDn(java.lang.String p_clientId)
-
remove
public void remove(Client client)
-
updateAccessTime
public void updateAccessTime(Client client, boolean isUpdateLogonTime)
-
getAttribute
public java.lang.Object getAttribute(Client client, java.lang.String clientAttribute) throws InvalidClaimException
- Throws:
InvalidClaimException
-
decryptSecret
public java.lang.String decryptSecret(java.lang.String encryptedClientSecret) throws org.gluu.util.security.StringEncrypter.EncryptionException
- Throws:
org.gluu.util.security.StringEncrypter.EncryptionException
-
encryptSecret
public java.lang.String encryptSecret(java.lang.String clientSecret) throws org.gluu.util.security.StringEncrypter.EncryptionException
- Throws:
org.gluu.util.security.StringEncrypter.EncryptionException
-
-