/sample-monorepo

Sample mono repo app (with multiple components) that demonstrate authentication using Crossid.

Primary LanguageJavaScript

sample-monorepo

A mono repo with multiple services and frontends, demonstrating how to perform authentication and authorization on different languages and frameworks with Crossid.

It let you:

  • Protect APIs with OAuth2 access token, for Golang.
  • Authenticate users at Crossid and consume the protected APIs, for React.
  • One click/command deployment on DigitalOcean.

Prerequisite

Running locally

Deploying on Digital Ocean

Note: when creating the single page app, put a temporary URLs in Redirect URI and Logout URI until the app is deployed.

  • Install doctl[https://github.com/digitalocean/doctl]
  • Form the repo.
  • Change env vars in api.yaml such: REACT_APP_CID_TENANT_ID, REACT_APP_CID_CLIENT_ID, VUE_APP_CID_TENANT_ID, VUE_APP_CID_CLIENT_ID and ISSUER_BASE_URL.

Then run:

doctl apps create --spec .do/app.yaml

Once app deployed, in DigitalOcean control pane, take a note of the app's public URL (references below as {public_url}).

Then, in Crossid admin's application page, set the following:

Login Redirect URIs:

  • https://{public_url}/react/
  • https://{public_url}/vue/callback

Logout redirect URIs:

  • https://{public_url}/react/
  • https://{public_url}/vue

Allowed CORS Origins:

  • https://{public_url}*

What is Crossid?

Crossid can:

  • Sign users in using various passwordless authentication factors (e.g., otp, fingerprint, etc...)
  • Sign users in via social providers (e,g. Facebook) or enterprise providers (e.g., Azure)
  • Multi factor authentication.
  • Issue signed OAuth2 and Openid-Connect access tokens to protect API calls.
  • Manage user profiles and access.
  • Authenticate machines.