OAuth2 Authentication Guide for Data as a Service

OAuth2 Authentication Guide for Data as a Service

Token Expiration

Token Expiration

When an access token expires and you attempt to use it, you will get an
accessToken expired
error. Using SOAP it will appear like this:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/ XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header/> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>accessToken expired</faultstring> <faultactor/> </soap:Fault> </soap:Body> </soap:Envelope>
While a REST JSON response will look like this:
{ "WebServiceResponse": { "@xmlns": "http://ws.strikeiron.com", "Error": "accessToken expired" } }
When this happens you need to request a new token using one of the methods described earlier. Ideally, you will pay attention to the
expires_in
value returned when you first received the token and request a new one before that time runs out. You are free to request a new token at any point, so to avoid receiving errors like the above you should generate a new token shortly before your previous one expires. Note that refresh tokens are not supported.

0 COMMENTS

We’d like to hear from you!