Add an App
What is an app?
An app represents your application where users logs in.
For simplicity, let's create a server-side web app.
note
Crossid supports various app types such as single page applications (SPA), mobile and APIs. for more info see application.
Start from a sample
To speed things up, let's start from a sample with a framework of your choice.
Framework | Repository |
---|---|
Node.js Express | see walk through |
Golang | https://github.com/crossid/samples-golang |
Each sample has a README.md file with instructions how to set up the sample.
note
For more in-depth guides per language, check languages.
Tell Crossid about your app
Once the app is running we should tell Crossid about it.
- Console
- Curl
- In Admin console, navigate to Integration โ Marketplace.
- Choose Web Application.
- Click on Add Integration.
- Follow wizard steps.
curl -X POST \
-H "Authorization: Bearer <API_TOKEN>" \
-d '
{
"type": "singlePageApp",
"data": [
{
"collectorId": "appDetails",
"vars": {
"displayName": "My App",
"appId": "myapp"
}
},
{
"collectorId": "oauth2Client",
"type": "oauth2Client",
"vars": {
"client_id": "myapp",
"redirect_uris": [
"https://localhost/callback"
],
"audience": ["https://localhost"]
}
}
]
}
' https://{tenant}.crossid.io/api/v1/apps/.provision/?reason=sample-app
Crossid will give you back client id and client secret needed for our app.
Update your app
Every time a user tries to login, the app should redirect to Crossid and provide the client id.
Follow the README.md of the sample project how to set the client_id and optionally the client_secret in your app.