wso2 / product-microgateway

Choreo Connect is a cloud-native, open-source, and developer-centric API gateway.
https://wso2.com/choreo/choreo-connect/
Apache License 2.0
287 stars 246 forks source link

Getting token failure issue in MGW #3533

Open chandimajayawickrama opened 1 month ago

chandimajayawickrama commented 1 month ago

Description

The token from IBM has changed recently to the following format.

some string.some string.some string

As you can see, the above contains two dots(.) which the MGW's Pre Authentication filter detects the token to be a JWT token but, since the token is not a JWT token, the MGW is throwing errors as below.

ERROR [ballerina/jwt] - String to JSON conversion failed for JWT header. : error {ballerina/io}GenericError message=unrecognized token '**********************************'
DEBUG [wso2/gateway/src/gateway/utils] - [JWTUtil] ['**********************************] Error while decoding the JWT token

Steps to Reproduce

Use an opaque token which has dots

Version

3.2.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response