Technical¶
Components¶
- Custom endpoints
- Application configuration
- Lime eServices BankID service
Custom endpoint description¶
Below describes the data passed in requests to the endpoints.
POST /login/
Request¶
When using limecrm type(i.e. username and password).
| parameter | datatype | description |
|---|---|---|
| type | string | The type used to log in, one of: limecrm or bankid |
| username | string | Input username |
| password | string | Input password |
When using BankID
| parameter | datatype | description |
|---|---|---|
| type | string | The type used to log in, one of: limecrm or bankid |
| personal_number | string | Input personal number |
Example response¶
{
"success": true,
"user": {
"_id": 1001,
"firstname": "Test"
"lastname": "Testsson",
"email": "test.testsson@lime.tech"
}
}
POST /bankid/collect/
This endpoint is only called when using BankID as login. Polls the BankID service for signing status.
Request¶
| parameter | datatype | description |
|---|---|---|
| transaction_id | string | Idenitifer for the current transaction |
Example response¶
{
"progressStatus": "COMPLETE",
"user": {
"_id": 1001,
"firstname": "Test"
"lastname": "Testsson",
"email": "test.testsson@lime.tech"
}
}
POST /reset/request/
Request¶
Request a password reset.
| parameter | datatype | description |
|---|---|---|
| username | string | Input username |
Example response¶
{
"msg": "Reset token set",
"token: "_uuid4_"
}
POST /reset/
Request¶
Reset the password using token.
| parameter | datatype | description |
|---|---|---|
| token | string | The token used to identify the request to reset the password |
| username | string | Input username |
| new_password | string | The new password to be set |
Example response¶
{
"msg": "Password updated"
}
GET /login/openid/
Request¶
| parameter | datatype | description |
|---|---|---|
| state | string | Random string generated by the consumer, e.g. portal |
Returns¶
Flask.redirect(https://provider_url?state=_state_)
GET /oauth2/authorize/
Request¶
| parameter | datatype | description |
|---|---|---|
| state | string | Random string generated by the consumer, e.g. portal |
| code | string | Code used to fetch access token at the provider, by the OAuth2 standard |
Returns¶
Flask.redirect(https://consumer_url?payload=_base64_)
payload parameter is encoded with base64 and contains
- Limeobject to log in
- State
- Logout nonce — the portal stores this and presents it on
/logout/openid/to prove a logout request was initiated by the portal
GET /logout/openid/
Performs RP-initiated logout at the OpenID provider, ending the single sign-on
session so the next login prompts for credentials again. The id_token stored
in the session during login is sent to the provider as id_token_hint.
Request¶
| parameter | datatype | description |
|---|---|---|
| post_logout_redirect_uri | string | Where the provider sends the user after logout. Must be on the same origin as the configured portal_redirect_uri, otherwise the request is rejected with 400. |
| logout_nonce | string | The nonce handed to the portal in the login callback payload. Proves the logout was initiated by the portal — a request without a matching nonce is redirected back to post_logout_redirect_uri without contacting the provider or changing the CRM session. |
Returns¶
Flask.redirect(https://provider_end_session_endpoint?post_logout_redirect_uri=_uri_&id_token_hint=_id_token_)
The user is redirected directly to post_logout_redirect_uri — without ending
the session at the provider — when the provider does not advertise an
end_session_endpoint in its server metadata, when the session has no stored
id_token, or when the logout_nonce is missing or does not match. When the
nonce validates, the stored OpenID data (id_token) and the nonce are cleared
from the CRM session regardless of which path is taken; on a nonce mismatch
nothing is changed, so a later legitimate logout still works.
Table and Field Definitions Lime CRM¶
Any limetype can be used with this package. Requirements are fields for idenitifying the user, which are configurable to each solution. Which fields are used is defined in the application config.