Skip to content

Retrieving oAuth token fails every time on first call  #8914

Closed
@yarivlifchuk

Description

@yarivlifchuk

Description
Kyma version 1.11.1

When calling the following curl to retrieve token there is a failure response and only in the 2nd call it succeed with new token.

curl -X POST -u {ClientId}:{ClientSecret} -d "grant_type=client_credentials&scope=application:read" https://oauth2.{domain}/token -H "Accept: application/json" -H "Accept-Language: en_US"

1st failed response
error":"invalid_client","error_description":"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authenticatio n method)","status_code":401}

2nd response
300{"access_token":"hbhwWJDunwBFlEAWJjHiqK3CvrICJ8dt7g-VMGI7TmI.yHg41WlnOOPzzm64cmscope":"application:read","token_type":"bearer"}

Expected result

Get success response on first shot.
300{"access_token":"hbhwWJDunwBFlEAWJjHiqK3CvrICJ8dt7g-VMGI7TmI.yHg41WlnOOPzzm64cmscope":"application:read","token_type":"bearer"}

Actual result
a failure response in the 1st attempt and only in the 2nd call it succeed with new token.

1st failed response
error":"invalid_client","error_description":"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authenticatio n method)","status_code":401}

2nd response
300{"access_token":"hbhwWJDunwBFlEAWJjHiqK3CvrICJ8dt7g-VMGI7TmI.yHg41WlnOOPzzm64cmscope":"application:read","token_type":"bearer"}

Steps to reproduce
Call the following URL (replace clientId,clientSecret and Kyma domain)

curl -X POST -u {ClientId}:{ClientSecret} -d "grant_type=client_credentials&scope=application:read" https://oauth2.{domain}/token -H "Accept: application/json" -H "Accept-Language: en_US"

Troubleshooting
Calling it several times until succeed response

Metadata

Metadata

Assignees

Labels

area/securityIssues or PRs related to securityarea/service-meshIssues or PRs related to service-meshkind/bugCategorizes issue or PR as related to a bug.kind/failing-testCategorizes issue or PR as related to a consistently or frequently failing test.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions