cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
924
Views
0
Helpful
8
Replies
Enthusiast

Oauth token expired

When using the Java SDK, I start the connection and it works fine for a while. But then eventually I get a message like this:

com.cisco.thunderhead.errors.UnauthorizedRestApiException: null: RestApiError with errorType: unAuthorized, errorData: NonBlockingOAuthClient expired token, errorMessage: Oauth token has expired and could not be refreshed

Is there a keepalive method I should be calling to keep the Oauth token from timing out? Or to request a new token?

I haven’t ran across that in the docs.

8 REPLIES 8
Cisco Employee

Re: Oauth token expired

Hi,

While you initialize SDK, SDK should start a thread to renew your OAuth token every hour. Token you get is valid for 2 hors but is refreshed every hour. You should not have to take extra steps for this. Seems like either SDK failed to start refresh thread of refresh token fails.

Did you see this error after 1 hour of using SDK or after 2 hours?

Can you please send more logs so we can do some investigation for this issue?

Thank you

Ankit

Enthusiast

Re: Oauth token expired

logs sent via Spark. Thanks

Enthusiast

Re: Oauth token expired

Was there any result to this analysis? Should I be able to run more than two hours at a time now?

Cisco Employee

Re: Oauth token expired

Jeremy,

Sorry for the delay in response. Based on logs, we see that you are trying to use both Context and Management connector from same JVM. This is not supported by Context Service. Each connector needs to be running from separate JVM.

Thank you

Ankit Parikh

Enthusiast

Re: Oauth token expired

Can you ping me to the docs that outline that requirement?

Cisco Employee

Re: Oauth token expired

Hi Jeremy,

Please refer to: Cisco DevNet: Context Service - Context Service SDK Guide

You cannot create both a management connection and client connection on the same Java virtual machine.

Thank you

Ankit Parikh

Highlighted
Enthusiast

Re: Oauth token expired

Was that block of text recently added? I don’t remember seeing that before…

Cisco Employee

Re: Oauth token expired

Jeremy,

This line was added in the SDK Guide after you raised an issue with expired OAuth token. After debugging, we updated the DOC to indicate that running both connector on same JVM is not supported.

Context team should have reached out to you after our analysis. Again, I am sorry for the delay in response.

Thank you

Ankit Parikh

CreatePlease to create content
Content for Community-Ad
June's Community Spotlight Awards