InvalidOperationException: Scheme already exists: Bearer after upgrade to netcoreapp2.0 #1412
Comments
I think you need to show more code. Show the entire Startup.cs file. |
Here you go. I only stripped irrelevant parts
|
When I specify in the authentication some other scheme for testing like
Then I get another message
Maybe this can give some clue? |
Hi @davidfowl , I found the problem. I has some custom middleware which uses parts of aspnet identity and there I had Anyway THX for the quick response! |
@RobinHerbots I'm seeing the same issue - what exactly did you change? |
@x3igh7 , As in my previous comment. I had some custom middleware which also added authentication, which causes the above error. |
Hi |
Try commenting all in startup | configureservices, then uncomment until you got the error. |
Hi @RobinHerbots Any help, please? |
check if you do not have 2x |
Got here with "Scheme already exists: Windows" with an empty Configure. I have just converted Startup to IStartup so I can pass arguments to it. |
@jhudsoncedaron please share your Startup code. |
|
There's no auth in that Startup. What's the full stack trace of the exception? |
The only auth is:
|
Ah, HttpSys cannot be used with IIS, you must use Kestrel with IIS. |
As for your server.urls issue, see aspnet/MetaPackages#226 |
I'm reading server.urls out of appsettings.json. Back to the main issue; commenting out .UseIISIntegration() doesn't change anything. |
Are you trying to run this application in IIS/Express? |
Nope. It wouldn't work anyway. |
On further probing I found the failure happens only when starting under Visual Studio. I'm not going to say I understand this because I definitely don't. |
VS runs the IIS Express profile by default, you have to change your launch profile in the dropdown to launch as a console app. |
Ok I managed to work everything else out from there. VS appears pretty broken after changing the setting but that might be my fault. |
@wgutierrezr I also had and fixed the same error: |
For others that come across this error, in my case I had setup using OpenIddict and the following line caused the error for me:
|
Hi all,
I'm a bit stuck here and any suggestions are welcome.
I upgraded my netcoreapp1.1 to netcoreapp2.0, => after some struggle I got everything compiled.
When running after the app.UseAuthentication(); command I got the below.
I stripped down the startup to solely the authentication
The text was updated successfully, but these errors were encountered: