Akvo SSO login - akvo/akvo-flow-api GitHub Wiki
The Akvo Flow API uses OpenID connect for authentication.
Firstly, a user account is needed, if you don't have any, you'll need to access your flow instance first https://<flow-instance>.akvoflow.org/ (e.g: https://uat1.akvoflow.org/), then click on create account and complete the required user details to have your user account. Don't forget to validate your email, clicking in the confirmation link that will be sent to your inbox.
The ID_TOKEN is a token issued as a result of user authentication.
In the following http request call, to get the ID_TOKEN, replace <user-email> and <user-password> with your current user email and password
curl -s \
-d "client_id=S6Pm0WF4LHONRPRKjepPXZoX1muXm1JS" \
-d "username=<user-email>" \
-d "password=<user-password>" \
-d "grant_type=password" \
-d "scope=openid email" \
"https://akvofoundation.eu.auth0.com/oauth/token"The response will have the following structure, including the ID_TOKEN
{
"token_type": "Bearer",
"expires_in": 86400,
"scope": "openid email ....",
"id_token": "eyJ0eXAiOiJKV1Q....",
"access_token": "eyJ0eXAiOiJ...."
}Pay attention to the expires_in value too. In this previous example response, the ID_TOKEN will expire in 86400 seconds (24 Hours)
The ID_TOKEN is the token that should be used in the Akvo Flow Authorization header.
Below, there is an example showing how to include the ID_TOKEN in the http flow-api call (replace <FLOW_ORGANIZATION_SUBDOMAIN> with your organization value and <ID_TOKEN with the value obtained in your previous http call)
curl --header "Content-Type: application/json" \
--header "Accept: application/vnd.akvo.flow.v2+json" \
--header "Authorization: Bearer <ID_TOKEN>" \
--request GET \
--url "https://api-auth0.akvo.org/flow/orgs/<FLOW_ORGANIZATION_SUBDOMAIN>/folders?parent_id=0"
In this link: https://github.com/akvo/akvo-flow-api/wiki/Akvo-Flow-REST-API you could find all the flow rest api documentation related