Skip to content

Onboarding & SSO

To provision new users with MyPup and allow existing users to sign on using SSO (Single Sign-On), you only need to redirect users to a single URL.

Flow

Following sequence diagram shows a typical user flow using the community login redirect url.

sequenceDiagram
  autonumber
  Community App->>MyPup: /LoginCommunity
  break When already logged in
    MyPup->>User: Show MyPup web app
  end
  MyPup-->>User: Send code via mail
  User-->>MyPup: Confirm login code
  opt When returnUrl specified
    MyPup->>Community App: Redirect to returnUrl
    Community App->>User: Redirect to com_return_url
    User->>MyPup: Navigates to MyPup
  end
  opt When it's a new user
    MyPup-->>User: Check details and location?
    User-->>MyPup: Confirm details and location
    MyPup-->>User: Accept conditions?
    User-->>MyPup: Accept MyPup conditions
  end
  MyPup->>User: Show MyPup web app

URL

Redirect users to the following URL with a couple of query strings. Note that you must url encode the values.

Base URL: https://login.mypup.app/LoginCommunity

Query Mandatory Description
email Email address of the user.
uuid Your user's uuid. We'll use this uuid to uniquely identify the user with your app. We'll send this uuid in the callback messages as well.
auth Your auth key you'll receive from us.
first First name of the user.
last Last name of the user.
phone Phone number, preferrably in an international number format.
pup Name, address, city, mailbox of the pick up point to search for during onboarding. When there's only one match, the location will be automatically selected. When there are multiple pick up points found, the user needs to select a location. For example, use 1101AG to only filter the pick up points for that mailbox.
lang Language code (e.g. en, nl, de) to use for onboarding.
returnUrl Optional return url to redirect to after succesfull login. See more info below. If you leave this empty the user will automaticlaly redirect to the MyPup platform.
state When returnUrl specified, this state will be part of the redirect url query string.

Cookies are mandatory for Single-Sign-On

Without cookies, the user will need to login every time you redirect them to the login url.

Return URL

If you choose to specify a returnUrl value, the user wll be redirected to this URL after succesfull login. The query string values below will also be added the returnUrl. After the redirect, you need to manually redirect the user to the com_return_url. This way the user will automatically login.

Return Query String Description
com_state The value from state you supplied in the original login url.
com_uuid The value from uuid you supplied in the original login url.
com_return_url An url you should to redirect the user to afterwards. This way the user is automatically logged in.

Examples

Case URL
Minimum https://login.mypup.app/LoginCommunity?email=john.doe@example.com&uuid=7ab78c8f28x&auth=94c2...a9b1
All meta data https://login.mypup.app/LoginCommunity?email=john.doe@example.com&uuid=7ab78c8f28x&auth=94c2...a9b1&phone=0031612345678&first=John&last=Doe&pup=Amsterdam&lang=en
With return url https://login.mypup.app/LoginCommunity?email=john.doe@example.com&uuid=7ab78c8f28x&auth=94c2...a9b1&state=TEST123&returnUrl=https%3A%2F%2Fmy.community.app%2FMyPupLogin