Open gassc opened 2 years ago
I have the business logic for this middleware worked out in a test Flask app from several years ago.
We can use the existing setup @ atlas.3riverswetweather.org for this. The SSO route can also go get the AGS Token and put it into the session.
See this post for the pattern for accessing secured services with ArcGIS JS API v 4: https://community.esri.com/t5/arcgis-api-for-javascript-questions/how-do-i-pass-token-to-secure-service-using-arcgis/td-p/753271
I've got an endpoint worked up in a Flask app that will do this.
Feed it the src
("3RWW") and the idStr
from a successful MDS SSO login:
/mds-atlas-auth/<src>/<idStr>
It returns a JSON response:
{
"data": {
"ago": {
"message": "Not implemented yet.",
"token": null
},
"ags": {
"message": "3RWW Esri ArcGIS Server token acquired",
"token": {
"expires": 1694619433344,
"token": "..."
}
},
"mds": {
"authenticated": true,
"message": {
"@MESSAGE": "Authentication Successful",
"USER": {
"EMAIL": "christian.gass@civicmapper.com",
"EXPIRES": "9/12/2023 1:03:14 PM",
"FIRST_NAME": "Christian",
"LAST_NAME": "Gass",
"RESULT": "1",
"ROLE": "2",
"SESSION": null,
"UNIQUEID": "2037"
}
},
"token": "0e6e355b-cde2-48b0-a7a1-5093ef4d458b"
}
},
"status": "success"
}
The response JSON has two top level keys: status (one of success, fail, error), and data.
The data
object has three things:
mds
which returns the result of the authentication call to mds.3riverswetweather.org/sso/sso.ashx,ags
which has the ArcGIS Server token we need for the appago
which will be a token for ArcGIS Online that we may need
Need middleware and a REST API endpoint to handle authenticating with 3RWW's existing legacy SSO system.
Initially this will be used by the Sewer Atlas v3.