IdentityModel.OidcClient icon indicating copy to clipboard operation
IdentityModel.OidcClient copied to clipboard

Trust anchor for certification path not found

Open ghost opened this issue 3 years ago • 1 comments

I'd like to connect a xamarin app to and identity server (locally on my machine, app is running in emulator) I follwed the sample code:

Client ` var browser = DependencyService.Get<IBrowser>();

                    var options = new OidcClientOptions
                    {
                        Authority = _httpConfig.DiscoveryUrl, // <- https://https://10.0.2.2:5501
                        ClientId = "xamarin",
                        Scope = "openid",
                        RedirectUri = "xamarinformsclients://callback",
                        Browser = browser,
                        RefreshTokenInnerHttpHandler = new HttpClientHandler()
                    };
                    _oidcClient = new OidcClient(options);
                    var _result = await _oidcClient.LoginAsync(new LoginRequest());`

Server ( https://127.0.0.1:5501) { "ClientId": "xamarin", "RequireClientSecret ": false, "AllowedGrantTypes": [ "code" ], "AllowedScopes": [ "openid" ], "RequirePkce": true, "RedirectUris": "xamarinformsclients://callback", "AllowAccessTokensViaBrowser": true, "RequireConsent": false }

this call var _result = await _oidcClient.LoginAsync(new LoginRequest());` causes this error: "Trust anchor for certification path not found"

Any ideas?

ghost avatar Sep 28 '21 18:09 ghost

Sounds like an HTTPS issue

leastprivilege avatar Sep 28 '21 20:09 leastprivilege