Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  1. Fotoware Alto
    • 11.14 Schreckhorn
    • Terminology
    • Solutions
    • User Guide - Deutsch
    • User Guide - English
    • API Changelog
  2. Fotoware Veloz
    • Managing users and groups
    • Configuring archives
    • Configuring workflows
    • Configuring site behavior
    • Navigating and searching to find your assets
    • Working with your assets
    • Editing asset metadata
    • Uploading files
    • Version Control in Fotoware
    • Albums - Creating and sharing collections
    • Placing assets in a CMS
    • Working with the Fotoware Pro interface
    • Using the Fotoware plugins
    • Consent management
    • User guide to FotoWeb for iPad (Legacy)
    • Picture conferencing with FotoWeb Screens (Legacy)
    • What's what in Fotoware
    • GDPR
    • Fotoware Veloz releases
    • Activity Exports
    • Fotoware Example Workflows
  3. Fotostation
    • Getting started with Fotostation
    • Viewing, selecting and sorting files
    • Managing your assets with archives
    • Adding metadata to assets
    • Searching for assets
    • Working with your assets
    • Version Control in Fotostation
    • Automating tasks with Actions
    • Configuring metadata fields and editors
    • Configuring Fotostation
    • Configuring Fotostation for multi-user environments
    • Troubleshooting Fotostation
  4. Fotoware Flow
    • What is Flow?
    • Getting started
    • Flow dictionary
  5. Fotoware On-Premises
    • Getting started
    • Index Manager
    • FotoWeb
    • Color Factory
    • Connect
    • Operations Center Guide
  6. Integrations and APIs
    • The Fotoware API
    • Creating integrations using embeddable widgets
    • Authorizing applications using OAuth
    • Auto-tagging
    • FotoWeb Drag and Drop export
    • Integration using webhooks
    • Optimizely and Episerver plugin documentation
    • User Interface Integrations
  7. Fotoware Mobile
    • User guide for Fotoware Mobile for iPhone and Android
    • User guide to FotoWeb for iPad (Legacy)
    • User guide to FotoWeb for iPhone and Android (Legacy)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Support

Table of Contents

Refresh token life span
  • Home
  • Integrations and APIs
  • Authorizing applications using OAuth

Refreshing tokens

01. April 2025

Elaine Foley

Table of Contents

Refresh token life span

For reasons of security and performance, access tokens have a limited and usually very short lifetime. After an access token has expired, the client has to request a new one to continue using the FotoWeb API. There are 2 ways to do so:

  • Repeat the authorization process
  • Request a new access token using a refresh token

Refresh tokens may be obtained together with access tokens if authorization code grant type is used. Refresh tokens are not available when using implicit grant type.

A new access token is requested using a refresh token as follows:

POST https://myfotowebserver.com/fotoweb/oauth2/token
Content-Type: application/x-www-form-urlencoded
Accept: application/json
grant_type=refresh_token&refresh_token=REFRESH_TOKEN&client_id=CLIENT_ID&client_secret=CLIENT_SECRET

where

Parameter Description
grant_type REQUIRED. Must always be refresh_token.
client_id REQUIRED. The unique ID of the client, which was obtained during client registration.
client_secret

The secret of the client, which was obtained during client registration.

REQUIRED if the client is a web application (was registered with a client secret).

MUST NOT BE GIVEN if the client is a native application or single-page application (was registered without a client secret).

refresh_token REQUIRED. The refresh token obtained during authorization.

On success, the server responds as follows:

200 OK
Content-Type: application/json

with the following response body:

{
 "access_token": ACCESS_TOKEN,
 "token_type": "bearer",
 "expires_in": EXPIRES_IN_SECONDS,
 "refresh_token": REFRESH_TOKEN
}

where

Parameter Description
access_token The access token that is used to authorize requests to the FotoWeb API 
token_type This is always bearer.
expires_in Number of seconds after which the token is expected to expire.
refresh_token OPTIONAL: A new refresh token.

The application can obtain the access token by parsing the response body.

If FotoWeb issues a new refresh token in the response, then the old refresh token (i.e. the refresh token used in the request) is no longer valid.

It is unspecified if and when FotoWeb will issue new refresh tokens when they are used to request new access tokens, so the client MUST support this case, even if it appears that FotoWeb does not issue new refresh tokens.

Refresh token life span

Refresh tokens have an unlimited lifetime. However, future versions may have the possibility to limit the refresh token lifetime. Also, both users and administrators may perform actions that cause refresh tokens to be deleted (such as by changing application settings or logging out of all sessions).

Applications need to handle the case of a refresh token that has been invalidated and, in this case, should either ask the user to re-authenticate and/or show an error message (depending on what is best-suited to the situation).

For this reason, it is not recommended to use refresh tokens for non-interactive applications, as the user would not be able to take action when a refresh token is invalidated. For non-interactive applications, see Non-interactive application authorization with OAuth 2.0 

An application that uses refresh tokens should provide a Log out button, or another easily accessible option, for users to delete the refresh token and re-authenticate (for example, by using a different user account and granting different permissions). If an application only stores the refresh token in the memory and not on disk, then restarting the application may be an acceptable method to log out. 

Note that users may not be familiar with terminology such as refresh tokens or authenticate, so Log out or Sign out are more user-friendly labels for a button, even if they are technically incorrect in OAuth terminology.

access renewing

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Application registration using OAuth 2.0
  • Get started with OAuth
  • Authorizing a client using OAuth 2.0
  • Enabling Cross-Origin Resource Sharing (CORS) in Fotoware
eco-lighthouse-miljøfyrtårn

Company

  • About us
  • Resellers
  • Careers
  • Contact us

Help & support

  • Support center
  • Consultancy
  • Tech partners
  • Fotostation
  • System status

Trust Center

  • Legal
  • Security
  • Sustainability & ESG

Locations

Fotoware AS (HQ)
Tollbugata 35
0157 OSLO
Norway
FotoWare Switzerland AG
Industriestrasse 25
5033 Buchs (AG)
Switzerland

Copyright 2025 Fotoware All rights reserved.

  • Terms of service
  • Privacy policy
  • Cookie policy

Knowledge Base Software powered by Helpjuice

Expand