Auth
Auth REST API
Sign in with email / password
You can sign in a user with an email and password by issuing an HTTP POST request to the auth
endpoint.
Method: POST
Content-Type: application/json
Endpoint: https://[CEAP_DOMAIN]/api/auth
Request Body Payload
Property Name | Type | Description |
---|---|---|
string | The email the user is signing in with. | |
password | string | The password for the account. |
Response Payload
Property Name | Type | Description |
---|---|---|
token | string | The token for the authenticated user. |
expiresIn | int | The number of seconds in which the ID token expires. |
refreshToken | string | The refresh token for the authenticated user |
Sample response
{
"token": "eyJhbGciOiJIUzUxMiJ9.eyJhdXRoIjoiUk9MRV9TWVNfVVNFUixQRVJNX1NZU19EWU5BT.2pQ7a6xiYaGxtx7LEr9QST9cgjsNTp66qL5WiGitcaHEjg58g11NYHCmOA--bcd6JUfgHyUdrKrbU18w0FZcCQ",
"expiresIn": 1800,
"refreshToken": "eyJhbGciOiJIUzUxMiJ9.eyJhdXRoIjoiUk9MRV9TWVNfVVNFUixQRVJNX1NZU19EWU5BTUlDX09CSkVDVF9MT0FELFBFUk1fU1lTX1NDUkVFTl9MT0FELFBFUk1fU1lTX1BST0NFU1NfTE9BRCxQRVJNX1NZU19DVVNUT01fQ09ERV9MT0FELFBFUk1fU1lTX0dST1VQX0xPQUQsUEVSTV9TWVNfRklMVEVSX0xPQUQsUEVSTV9TWVNfVEVNUExBVEVfTUFJTF9.seRodSs6wKzk6a6Qawn7JevPZ6VyX2QnvaYxRQXcLR2tCu5WmUW-Vyb0KKc2XIQPg58MX4K4ir2AaZMFQ6paAA"
}
Exchange a refresh token for an Auth token
You can refresh an Auth token by issuing an HTTP POST request to the refreshToken
endpoint.
Method: POST
Content-Type: application/json
Endpoint: https://[CEAP_DOMAIN]/api/auth/refreshToken
Request Body Payload
Property Name | Type | Description |
---|---|---|
refreshToken | string | A Auth refresh token.. |
Response Payload
Property Name | Type | Description |
---|---|---|
token | string | The token for the authenticated user. |
expiresIn | int | The number of seconds in which the ID token expires. |
refreshToken | string | The refresh token for the authenticated user |
Sample response
{
"token": "eyJhbGciOiJIUzUxMiJ9.eyJhdXRoIjoiUk9MRV9TWVNfVVNFUixQRVJNX1NZU19EWU5BT.2pQ7a6xiYaGxtx7LEr9QST9cgjsNTp66qL5WiGitcaHEjg58g11NYHCmOA--bcd6JUfgHyUdrKrbU18w0FZcCQ",
"expiresIn": 1800,
"refreshToken": "eyJhbGciOiJIUzUxMiJ9.eyJhdXRoIjoiUk9MRV9TWVNfVVNFUixQRVJNX1NZU19EWU5BTUlDX09CSkVDVF9MT0FELFBFUk1fU1lTX1NDUkVFTl9MT0FELFBFUk1fU1lTX1BST0NFU1NfTE9BRCxQRVJNX1NZU19DVVNUT01fQ09ERV9MT0FELFBFUk1fU1lTX0dST1VQX0xPQUQsUEVSTV9TWVNfRklMVEVSX0xPQUQsUEVSTV9TWVNfVEVNUExBVEVfTUFJTF9.seRodSs6wKzk6a6Qawn7JevPZ6VyX2QnvaYxRQXcLR2tCu5WmUW-Vyb0KKc2XIQPg58MX4K4ir2AaZMFQ6paAA"
}
How to local debug the SSO
The SSO project is in: https://gitlab.miisy.me/integration/me-sso-saml2
How to Debug: 1 - Set the port to 8090 and use the https://samltest.id/
2 - Run the project, access http://localhost:8090 and click to download the MetaData
3 - Access the https://samltest.id/ and upload the metadata
4 - Access the http://localhost:8090, click on show providers, and then click in https://samltest.id/saml/idp to see if the configuration is done
5 - Configure the properties in the meceap pointing to samltestid
<meceap.social.custom.id>samltestid</meceap.social.custom.id>
<meceap.social.custom.secret>xxxxx</meceap.social.custom.secret>
<meceap.social.custom.url>http://localhost:8090</meceap.social.custom.url>
6 - Now you can access and debug the SSO adding a break point in MEConnectionRepository class