Discussions
CORS Error SSO Client App
5 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 POSTrequest (Step 2 in SSO Docs section titled 'How Does Single Sign On Work?')
- Created 'fetch' that sends POSTrequest 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_tokenof Token request in react stateaccToken.
- As per step 5 in SSO Docs section titled 'How Does Single Sign On Work?', using the access_tokenin subsequent calls where theaccess_tokenvalue is a bearer token in the Authorization header causes a CORS error.
- Using XMLHttpRequestinstead offetchwith Authorization header andaccess_tokenvalue causes (CORS error).
What I have tried
- Using XMLHttpRequestinstead offetchwith Authorization header andaccess_tokenvalue causes (CORS error).
- Checked IIS settings for allowing http verbs/ http responses in iMIS Asi.Scheduler IIS website.
- Tried using httpswith 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.
