Authenticate a user » History » Revision 1
Revision 1/6
| Next »
Eric Vieillevigne, 05/12/2015 12:27 PM
{{>toc}}
h1. Authentication - log
In order to use the API you must be a valid user and be authenticated by the platform. First you have to create an account. In order to perform this tasks you shall use the API.
Account Creation - logcreate¶
This method creates a new account into the platform with at least one email
Open a session with the created account, even if the account identifier is not validated yet. (see loginByPassword for detail about the session).
By sending an HTTP request http://stagingapi.familywall.com/api/log/create?identifier=mynewid%40de.de&password=mynewpassword
Parameters:
| Name | Type | Description |
| Login | String | Login Information |
| Password | String | Password Information |
Response:
{
"a01":{
"r":{
"r":"675"
},
"cn":"logcreate"
}
}
The Method response is a Long which represents the AccountId of the account created .
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
Error:
| Error Code | Type | Value | Description |
| FizAccountAlreadyExistsException | Ex | 2 | Login already exists |
| FizCredentialInvalidException | Ex | 3 | Authentication Exception |
Account Authentication- login¶
In order to log-in into the platform and create a session, the log method shall be called. By calling http://stagingapi.familywall.com/api/log/in?
identifier=accid&password=pwd the system will provide a session token enabling the client application to perform authenticated operations. However this is transparent to the API
because this is sent via the api session layer (usually under the form of a JSESSIONID).
Parameters:
| Name | Type | Description |
| identifier | String | Account Information Id |
| Password | String | Password Information |
Response:
{
"a01":{
"r":{
"r":"130"
},
"cn":"login"
}
}
The Method response is a Long which represents the AccountId of the account logged.
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
Error:
| Error Code | Type | Value | Description |
| FizAccountIdentifierNotValidatedException | Ex | 4 | Email is not validated yet |
| FizCredentialInvalidException | Ex | 3 | Authentication Exception |
| FizAccountNotFoundException | Ex | 1 | Account does not exists |
Account Log Out- logout¶
The client can call the method logout to terminate the session initiated by the methog login.
http://stagingapi.familywall.com/api/log/out
Parameters:
The method does not necessitate a parameter. It uses the JSESSIONID stored on the session cookie to request to the server the session invalidation
Response:
{
"a01":{
"r":{
"r":"true"
},
"cn":"logout"
}
}
The Method response is a Boolean which returns TRUE as a results when session is effectively invalidated and FALSE when the session does not exists anymore.
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
Error:| Error Code | Type | Value | Description |
| FizAccountNotFoundInSessionException | un | 501 | Session is invalid |
| FizApiInvalidParameterException | un | 502 | invalid token |
| FizApiModelDoesNotExistException | un | 503 | Object does not exists |
| FizApiModelRightException | un | 504 | Right exception to use this method |
Account Validation- logtoken¶
The logtoken method is used to validate an account identifier. If the account identifier is existing, the account identifier shall not be verified yet. If the validation Token
is ok, the account identifier is validated and a session with the account is opened. If the validation token is invalid, the FizCredentialInvalidException will be thrown.
http://stagingapi.familywall.com/api/log/token?identifier=id&token=string
Parameters:
| Name | Type | Description |
| identifier | String | Account Information Id |
| Token | String | Token Information |
Response:
{
"a01":{
"r":{
"r":"130"
},
"cn":"logtoken"
}
}
The Method response is a Long which represents the AccountId of the account logged.
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
Error:
| Error Code | Type | Value | Description |
| FizCredentialInvalidException | Ex | 3 | Authentication Exception |
| FizAccountNotFoundException | Ex | 1 | Account does not exists |
| FizAccountNotFoundInSessionException | un | 501 | Session is invalid |
| FizApiInvalidParameterException | un | 502 | invalid token |
| FizApiModelDoesNotExistException | un | 503 | Object does not exists |
| FizApiModelRightException | un | 504 | Right exception to use this method |
Updated by Eric Vieillevigne over 10 years ago · 1 revisions