unee-t / frontend

Meteor front end
https://case.dev.unee-t.com/
GNU Affero General Public License v3.0
9 stars 17 forks source link

Auto otp login #844

Closed nbiton closed 5 years ago

nbiton commented 5 years ago

Resolves #808

Automatic login flow instructions for 3rd party apps

Step 1

POST to https://case.unee-t.com/api/otp-token with the following request body:

{
    "creatorApiKey": "...",
    "userApiKey": "..."
}

creatorApiKey is the MEFE API key retrieved for the user which created via UNTE the user which is associated with userApiKey. This request should respond with the following details:

{
    "token": "256285",
    "userId": "npt8xFdyiRQGcWEMv"
}

Step 2

Use the details from step 1 to construct a URL and open a browser/WebView for the user with the following URL template: https://case.unee-t.com/<requested path>?userId=<userId>&otp=<token>

<requested path> can be any valid path the 3rd party would like their user to access immediately after the automatic login is completed. For example: case/302/details No action will be needed to be taken by the user to access the requested path.