Recent searches


No recent searches

Failed to decode JWT

Answered


Posted Jun 02, 2022

Hi you guys,

I took the steps according to the documentation to enable authenticated visitors for messaging with Zendesk SDKs. https://developer.zendesk.com/documentation/zendesk-web-widget-sdks/sdks/web/enabling_auth_visitors/?_ga=2.268652913.1675815841.1654150203-1035270265.1654150203. But I experienced a problem as below. Give me some help to solve the thing, please 


0

6

6 comments

image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Toan,

Can you share the corresponding code snippets so we can see how you're handling the JWT? 
 
Thanks 

0


We build the mobile app, which integrated with Zendesk, by using flutter library dart_jsonwebtoken

0


image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Toan,

Unfortunately we don't support flutter, so the amount of debugging I can do is pretty limited. Have you checked to see if the JSON can be properly decoded using a tool like JWT.io? This may help you to isolate where the request is being malformed. Lastly, I've went ahead and deleted your code snippet as it shows your keys.

Apologies for not being able to be more assistance.

0


Toan Nguyen Did you manage to fix the issue ?

0


I'm getting: The JWT provided could not be decoded when trying to log in.

The JWT token is decoded as it should (via JWT.io).

I'm using the latest iOS SDK version - ZendeskSDKMessaging - 2.27.0

 

The secret and the kidare defined and used to construct the JWT token. Any idea what I've missed?

0


Just to add: 

The Zendesk is initialized before logging in. 

Zendesk.initialize(withChannelKey: Constants.channelKey,
                           messagingFactory: DefaultMessagingFactory()) { result in
            switch result {
            case .success(let zendesk): 
            	// Here I login with new JWT token generated by our server
            	login()
            case .failure(let error): break
            }
        }

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post