
9h7qt (9h7qt) asked a question.
Tried registering our localhost application in OKTA for implementing SSO with OIDC, my app built on angular + API(.Net Core).
After all configuration getting below error
Access to XMLHttpRequest at 'https://nathabhishek.okta.com/oauth2/default/v1/authorize?client_id=0oakauqvdZtQkadUs4x6&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fsignin-oidc&response_type=code&scope=openid%20profile&response_mode=form_post&nonce=637302477026533375.MjA4ODNlYWEtYWIzNy00YjNhLWE0NTMtYjY2NzU1ZWE4OGU3NGNkMDNmOGUtYjU5NC00NGExLTkwZGEtY2RjOWJhYjk5NzQ4&state=CfDJ8Fqc3LL1hn9Lr1PSSVYQB5JjOn0egUZHsa7Xhu368vUXAHvhViYFUgkyPCRFjxL5YcybihEoM23CUz8mJYI9tAF4o55jRiWqlSMF_MhqrB2fFKAvlDiK9pNHfXEBABhUPLlbzgHhLod-o-MGsRifZ6_Sjlz5LerQYQhfnOafBCbuE10h2GbLyCJl3RaM0UPW7hZFNaFs0d7fE2nJCDxub6-Cgkv0bGU4Pbc3zlQ81x2TgE7Bkq3jyJLswTtVYjn2FvvKjz6kyyFQrqxDU1x42UDHBNfIYJ5JUOp9owsVAsa94THJPqVlu4J6sRkzMyslGBG_SinkLBvssUxcO6Vm0hxu58Up0XV6nSg_URtMuZ3j&x-client-SKU=ID_NETSTANDARD1_4&x-client-ver=5.2.0.0' (redirected from 'http://localhost:5000/api/login/userSSOAuthentication') from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
(Note: Already enabled CORS for both localhost in OKTA profile)
Any help will be much appreciated

did you try to access your Application via Postman ? is it working ? Please confirm !
Secondly, can you try to allow Access Control Origin header from your application.
Allow a single specific origin:
Access-Control-Allow-Origin: [SCHEME]://[HOST]:[PORT_OPTIONAL]
Hi Sandeep,
We have allowed all origin
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials();
When we are directly running API through browser we are getting Okta login screen, but when running whole project UI throws error.