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

RequestAuthorizationCodeTokenAsync hanging #452

Open
zzstuzor opened this issue Dec 3, 2024 · 1 comment
Open

RequestAuthorizationCodeTokenAsync hanging #452

zzstuzor opened this issue Dec 3, 2024 · 1 comment

Comments

@zzstuzor
Copy link

zzstuzor commented Dec 3, 2024

I'm implementing OIDC in an Excel plugin, using IdentityModel and OidcClient. It works in x64 dotnet but seemingly not when running x86.

The auth server is returning me the first part of the code, but when I try to redeem the code it hangs.

ResponseProcessor.cs line 181 when calling await client.RequestAuthorizationCodeTokenAsync(...)

I'll get the source for IdentityModel and keep debugging, but it's been plaguing me for days - Has anyone else seen any issues with x86 dotnet?

private async Task<TokenResponse> RedeemCodeAsync(string code, AuthorizeState state, Parameters backChannelParameters, CancellationToken cancellationToken)
{
    _logger.LogTrace("RedeemCodeAsync");

    var client = _options.CreateClient();
// The following line hangs in x86 dotnet
    var tokenResult = await client.RequestAuthorizationCodeTokenAsync(new AuthorizationCodeTokenRequest
    {
...
@zzstuzor zzstuzor changed the title RequestAuthorizationCodeTokenAsync hanging when called from 32-bit dotnet RequestAuthorizationCodeTokenAsync hanging Dec 3, 2024
@zzstuzor
Copy link
Author

zzstuzor commented Dec 3, 2024

It seems to be hanging at the line below, and fails with a timeout.

I've created a basic console app to test it without the Excel plugin part, and it seems to be failing in both x64 and x86 (I've updated the ticket title to remove the 32-bit part). It works on one computer but not the other.

Any ideas why this part might fail even though the initial step of login succeeds? Perhaps some environmental issue on my computer?

internal static async Task<TokenResponse> RequestTokenAsync(this HttpMessageInvoker client, ProtocolRequest request, CancellationToken cancellationToken = default)
{
    request.Prepare();
    request.Method = HttpMethod.Post;
        
    HttpResponseMessage response;
    try
    {
// The following line stalls.
        response = await client.SendAsync(request, cancellationToken).ConfigureAwait();
...

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

No branches or pull requests

1 participant