Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

'<' is an invalid start of a value. LineNumber: 1 #249

Closed
woeterman94 opened this issue Dec 22, 2021 · 2 comments
Closed

'<' is an invalid start of a value. LineNumber: 1 #249

woeterman94 opened this issue Dec 22, 2021 · 2 comments

Comments

@woeterman94
Copy link

I configured a token client in my startup and attached it to an httpclient. But when doing an http request I get:

fail: IdentityModel.AspNetCore.AccessTokenManagement.AccessTokenManagementService[0]
      Error requesting access token for client identityserver. Error = '<' is an invalid start of a value. LineNumber: 1 | BytePositionInLine: 0.

Any idea what could be the cause of this?

@woeterman94
Copy link
Author

woeterman94 commented Dec 22, 2021

Okay, so apparently I have to pass the entire connect/token url in my startup

            services.AddAccessTokenManagement(options =>
            {
                options.Client.Clients.Add("identityserver", new ClientCredentialsTokenRequest
                {
                    Address = $"{authenticationConfiguration.IdentityServerBaseUrl}/connect/token",
                    ClientId = authenticationConfiguration.ClientId,
                    ClientSecret = authenticationConfiguration.ClientSecret,
                });
            })
            .ConfigureBackchannelHttpClient();

Without the connect/token part in the url it does not work

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants