Discussions
CORS Error SSO Client App
over 4 years ago by Brendan Jacobs(edited)
What's been done
Setup
- Setup Virtual Machine and installed iMIS.
- Added iMIS to IIS.
- Added Client App to iMIS.
- Added Single Sign On iPart to new link in Menu on iMIS.
- Configured ClientId and Client secret on Client Applications in iMIS.
Coding
- Created a new project in Visual Studio (ReactJS Front End)
- Configured Controller Classes to listen to
POST
request (Step 2 in SSO Docs section titled 'How Does Single Sign On Work?') - Created 'fetch' that sends
POST
request to iMIS token endpointhttps://imisteststationfakename.comp.co.za/Asi.Scheduler_iMIS0/token
(Step 3 in SSO Docs section titled 'How Does Single Sign On Work?').
Problem/ Progress Block
- Stored response
access_token
of Token request in react stateaccToken
. - As per step 5 in SSO Docs section titled 'How Does Single Sign On Work?', using the
access_token
in subsequent calls where theaccess_token
value is a bearer token in the Authorization header causes a CORS error. - Using
XMLHttpRequest
instead offetch
with Authorization header andaccess_token
value causes (CORS error).
What I have tried
- Using
XMLHttpRequest
instead offetch
with Authorization header andaccess_token
value causes (CORS error). - Checked IIS settings for allowing http verbs/ http responses in iMIS Asi.Scheduler IIS website.
- Tried using
https
with self-signed certificate for ClientApp in IIS. - Browsed Discussions in the iMIS community for answers from people who have faced similar errors.
- Took a deep breathe and walked through the documentation for SSO to make sure all steps are understood/implemented correctly.
TL;DR I have followed all the steps for configuring a Single Sign On Client App,
but I cannot use the access_token
received by POST
'ing to the token endpoint in
subsequent calls to the iMIS API, I am stuck with a CORS error. Please help.