question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OPTIONS requets returns 400 error while adding openiddict to asp.net core api

See original GitHub issue

hi Do I need to enable cors on OpenIddict separately? because I thought adding the following codes will handle the cors but as soon as Chrome want to send an options request, my app returns 400!

services.AddCors(); and app.UseCors(builder => builder.AllowAnyHeader() .AllowAnyMethod() .AllowAnyOrigin() );

I dont know If i need to add something else or not!

the configuration of openiddict is exactly as same as what I read from the wiki section if this project on github. and the project specifications are mentioned below

ASP.net Core v1.1 Client side : SPA Angularjs App using JWT Token

any help ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
kevinchaletcommented, Jun 12, 2017

Do I need to enable cors on OpenIddict separately?

You do.

Here is the configuration of openIdDict , it may help

You must register the CORS middleware before OpenIddict.

Don’t forget to update your CORS policy to use specific origins (AllowAnyOrigin is not safe).

0reactions
Foroughicommented, Jul 10, 2017

@PinpointTownes sorry for late responding , yes i used to which changing it to AddMVC fixed my issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asp.Net Core 2.1 WebApi returns 400 when sending ...
I've got an application that is represented by asp.net core 2.1 web api on the server side and angular 6 on the client...
Read more >
Asp.Net Core 6 Web API - How to return only 400 Bad ...
I have an ASP.NET core Web API that I am calling 3rd party web services. I have exception middleware in order to log...
Read more >
Implementing OpenID Code Flow with PKCE using OpenIddict ...
This article shows how to implement the OpenID Connect Code Flow with PKCE using OpenIddict hosted in an ASP.NET Core application, an ASP....
Read more >
Live Coding OAuth using OpenIddict and .NET - YouTube
https://andreyka26.com/ OAuth implementation using OpenIddict and .NET Git: ... ASP. NET Core Authentication Schemas (.NET 7 Minimal Apis C#).
Read more >
Blank page after log out #4730 | Support Center
This is a multitenant app, so I need to set a wildcard url in openiddict but it is not letting me. I'm using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found