kevinrjones / SettingUpIdentityServer

93 stars 59 forks source link

IdentityServer4 authorize not working #1

Open terminatorg opened 2 years ago

terminatorg commented 2 years ago

Hi, I'm trying your tutorial on youtube and created the IDS api with the client api but the authorize attribute doesn't work? I can't get the /.well-known/openid-configuration url to work either. Any idea as to why?

kevinrjones commented 2 years ago

I need some more information I'm afraid.

Have you tried cloning this repo? Does that work for you?

If not I may need to look at your code

ryangostling commented 6 months ago

@kevinrjones Hi. I'm facing the same issue when trying to upgrade projects to .NET 8. Although it works correctly with .NET 6.

This code throws the 'Unable to get discovery document' exception.

using var httpClient = new HttpClient();
_discoveryDocument = httpClient.GetDiscoveryDocumentAsync(identityServerSettings.Value.DiscoveryUrl).Result;
if (_discoveryDocument.IsError)
{
    logger.LogError($"Unable to get discovery document. Error is: {_discoveryDocument.Error}");
    throw new Exception("Unable to get discovery document", _discoveryDocument.Exception);
}

And when I tried to look deeper into the GetDiscoveryDocumentAsync I have found out that /.well-known/openid-configuration url returns 500 status code.

Do you know if IdentityServer4 is compatible with .NET 7 and higher?

kevinrjones commented 6 months ago

Hi Igor,

IdS 4 does not support .Net 8 unfortunately. If you want to use .Net 8 then I think you'd need to update to Duende IdS version 7,

Kevin

On Mon, May 20, 2024 at 11:20 PM Igor @.***> wrote:

@kevinrjones https://github.com/kevinrjones Hi. I'm facing the same issue when trying to upgrade projects to .NET 8. Although it works correctly with .NET 6.

This code throws the 'Unable to get discovery document' exception.

using var httpClient = new HttpClient(); _discoveryDocument = httpClient.GetDiscoveryDocumentAsync(identityServerSettings.Value.DiscoveryUrl).Result; if (_discoveryDocument.IsError) { logger.LogError($"Unable to get discovery document. Error is: {_discoveryDocument.Error}"); throw new Exception("Unable to get discovery document", _discoveryDocument.Exception); }

And when I tried to look deeper into the GetDiscoveryDocumentAsync I have found out that /.well-known/openid-configuration url returns 500 status code.

Do you know if IdentityServer4 is compatible with .NET 7 and higher?

— Reply to this email directly, view it on GitHub https://github.com/kevinrjones/SettingUpIdentityServer/issues/1#issuecomment-2121312792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDYGC6PQMIEQULRTQ3LTTZDJZMNAVCNFSM5NT235DKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJSGEZTCMRXHEZA . You are receiving this because you were mentioned.Message ID: @.***>

-- Kevin Jones KnowledgeSpike