Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't sign in due to exceptions #2

Open
max-arshinov opened this issue Jul 7, 2020 · 0 comments
Open

Can't sign in due to exceptions #2

max-arshinov opened this issue Jul 7, 2020 · 0 comments

Comments

@max-arshinov
Copy link

max-arshinov commented Jul 7, 2020

I am starting Api.Swashbuckle.csproj.user

dotnet run
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\max\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: c:\work\IdentityServer4-Swagger-Integration\Api.Swashbuckle
info: Microsoft.Hosting.Lifetime[0]

Now, when I am trying to authorize using Swagger I am redirected to https://localhost:5000/connect/authorize?response_type=code&client_id=demo_api_swagger&redirect_uri=https%3A%2F%2Flocalhost%3A5001%2Fswagger%2Foauth2-redirect.html&scope=api1&state=VHVlIEp1bCAwNyAyMDIwIDEzOjUzOjI5IEdNVCswMzAwICjQnNC%2B0YHQutCy0LAsINGB0YLQsNC90LTQsNGA0YLQvdC%2B0LUg0LLRgNC10LzRjyk%3D&code_challenge=B_M2Xf-8ZUdugsHiXmHvgPj4Nz-uIlqQoVmWMg1BRMk&code_challenge_method=S256 where I am getting ERR_SSL_PROTOCOL_ERROR

I am not sure, but this might be related to the security definition. My app servers HTTP on localhost:5000 and HTTPS on localhost:5001 using dotnet run command.

               options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
                {
                    Type = SecuritySchemeType.OAuth2,
                    Flows = new OpenApiOAuthFlows
                    {
                        AuthorizationCode = new OpenApiOAuthFlow
                        {
                            AuthorizationUrl = new Uri("https://localhost:5000/connect/authorize"),
                            TokenUrl = new Uri("https://localhost:5000/connect/token"),
                            Scopes = new Dictionary<string, string>
                            {
                                {"api1", "Demo API - full access"}
                            }
                        }
                    }
                });

I tried to use localhost:5001 in my security definition but in this case I am getting 404 error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant