Redmine OAuth2 for API applications

Redmine 6.1 and later can authorize applications through OAuth2 instead of shared API keys. This page explains how to register an application, run the authorization flow and move existing integrations safely.

On this page

Redmine OAuth2 for API applications: what changes from shared keys

If your integrations call the Redmine REST API with shared or personal API keys, you have no clean way to give each application its own access, limit it, or revoke it without disrupting other callers. OAuth2 authorization for API applications is available since Redmine 6.1, and it is the method to evaluate first for applications that need per-application, revocable access. Shared keys remain a workable option for simple scripts run by a single trusted service account, but they tie every caller to one credential that must be rotated everywhere at once.

The method covers registering an application with the Redmine instance, having a user authorize that application, and then letting the application call the API with the access token it receives. Basic authentication and the per-user API key sent as a parameter or in the X-Redmine-API-Key header are the methods described in the supplied REST API documentation, and they stay available for tools that cannot run an authorization flow. Before you design around OAuth2, confirm the exact administration screens, scope choices, token lifetimes and endpoints in the Redmine 6.1 or 7.0 documentation for the version you run, since the sources this page relies on describe only API keys and basic authentication. The Redmine REST API documentation is the starting point for confirming what your installed version supports.

The practical decision is which integrations move first. Start with an inventory of every caller that holds an API key, noting the owning team, the user the key belongs to, the resources it reads and writes, and whether it runs unattended. Integrations that act on behalf of a person are the strongest candidates for OAuth2, because the authorization records whose access the application is using. Service integrations with no human owner may need a dedicated service account either way, so plan that account's permissions with the same care you would give any role in your Redmine roles and permissions design. Confirm during testing that the application's requests are limited to what the granted access allows, and that revoking an application stops its calls without affecting other integrations.

Migration needs a sequence rather than a single cutover. Register the application in a test instance first, run the authorization flow with a test user, and check each endpoint the integration uses, including pagination and error handling for expired tokens. Keep the old key working until the new flow is proven, then remove the key from the integration's configuration and from any scripts, CI variables or secret stores where it was copied. Ask whoever maintains your Redmine instance to record which keys were retired and when, because that record is the evidence a security review will ask for. Your team should also confirm how the chosen Redmine version handles token refresh and revocation before setting any operational expectations.

What a team needs before registering an OAuth2 application

OAuth2 registration changes how every integration authenticates, so the prerequisites are as much about people and inventory as about settings. Confirm the Redmine line, the public address and the trust chain first, then map each existing integration to the endpoints it calls before anything is registered.

Redmine line and release

OAuth2 for API applications is available from Redmine 6.1, so a 5.1.x or older installation must be upgraded before this work can start. Redmine 7.0.x is the fully supported line and receives new features as well as security updates, while 6.1.x receives only bug fixes and security updates. The current stable releases listed are 7.0.2 and 6.1.5. Record the exact version in production and confirm whether the team will target 7.0.x, which gives the longest runway for planned changes.

Redmine download page

REST API enabled by an administrator

The Redmine REST API must be switched on by an administrator before any application can call it. Confirm this setting in the administration area of the production instance, not only in a test copy. Also confirm that the API accepts the JSON and XML formats your integrations request, because some existing clients depend on one format. Without the API enabled, OAuth2 registration will not help an application reach Redmine.

Redmine REST API docs

HTTPS public address

Each registered application needs a stable HTTPS address for Redmine that every user and client can reach. Decide the canonical hostname, confirm the certificate matches it, and make sure the Redirect URIs you register point to addresses under your control. Changing this address later means re-registering applications and updating every integration, so settle it before the first registration.

Named owner for each application

Each OAuth2 application should have one accountable owner who approves its scopes, holds its client secret process and answers when it misbehaves. Record the owner's name, team and deputy in your inventory. Ownership also matters when someone leaves, because an application without an owner tends to keep running with access nobody reviews.

Reverse proxy and certificate chain

Applications that call Redmine through a reverse proxy or a private certificate authority must trust the full certificate chain, including intermediates. Test the token request and API call from the same network path the application will use in production. Check proxy header handling and timeouts, since a misconfigured proxy can break the redirect step even when Redmine itself is healthy.

Inventory of integrations and endpoints

List every integration that uses a shared API key, including scripts, CI jobs, chat bots and reporting tools. For each one, record the Redmine endpoints it calls, such as issues, projects, users or time entries, and the actions it performs. This inventory sets the scopes each new application needs and shows which integrations can move first. Gaps here usually surface as broken jobs after cutover.

How an application obtains access to the Redmine API

The flow starts when a user signs in to the client application, which sends the browser to Redmine's authorization endpoint. After the user approves access, Redmine returns a code through the browser to the application backend, which sits on the trust boundary, so the client secret and token exchange stay on the server. The backend then calls the token endpoint and sends the issued access token with REST API requests. Confirm endpoint paths and token lifetimes in the documentation for your installed Redmine version before you build against them.

Authorization code flow from user browser to Redmine API calls.

How to register and connect an OAuth2 application to Redmine

This sequence moves an integration from a shared API key to a registered OAuth2 client that a test user has authorized, reads data through the REST API, and loses access once its grant is revoked. Each step ends with a check you can record before moving on.

  1. Enable the API and OAuth2 settings

    An administrator confirms that the REST API is enabled, which Redmine requires before any API client can call it, then turns on the OAuth2 options in the administration settings for Redmine 6.1 or later. Confirm the exact option names and locations in the Redmine REST API documentation and the release notes for your version, since this outline does not fix them. Done when the settings save without error and the settings page reloads with the OAuth2 options still enabled.

  2. Register the application and its redirect URI

    Create the application record in the Redmine administration area, enter the redirect URI where your integration receives the authorization code, and select the access the application needs. Enter the URI exactly, including scheme, host, port and path, because a mismatch is a common reason an authorization fails. Start with read-only access for a first integration. Done when Redmine issues a client identifier and the registration shows the redirect URI you entered.

  3. Store the client secret in the secret store

    Copy the client secret from the registration and place it in the secret store your integration already uses, such as a vault or your platform's encrypted secrets. Keep it out of source code, container images and shared configuration files. Give the integration's runtime read access to that one secret only. Done when the integration starts with the secret loaded from the store, and a search of its repository and build artifacts finds no copy of the secret.

  4. Complete one authorization as a test user

    Start the authorization flow with a dedicated test user whose role is limited to the projects the integration needs. The user signs in, approves the requested access, and Redmine redirects back to your integration with an authorization code. The integration then exchanges that code for an access token at the token endpoint documented for your Redmine version. Done when the exchange succeeds and the response contains an access token that works for the test user.

  5. Call a read-only endpoint with the token

    Send a GET request with the access token in the Authorization header to a core read-only resource such as projects or issues. Use the same test user so the results match what that user sees in the web interface. Note whether the response is JSON or XML, since both are supported by the REST API. Then attempt a write request, such as creating an issue, under the read-only grant. Done when the read call returns records matching the test user's visibility and the write attempt is refused with an authorization error.

  6. Revoke the grant and confirm access stops

    Revoke the authorization for the test user from the location your Redmine version provides for managing grants, then repeat the same read request with the old access token. Expect a 401 response, which shows the token no longer authenticates. If your version also issued a refresh token, confirm that it is rejected too. Done when the repeated call returns 401 and the integration requests new authorization and stops retrying, rather than looping on the failed call.

  7. Confirm the application identity in logs

    Review the Redmine production log for the requests made in the read and revoked-token checks, and find the entries that identify the OAuth2 application and the test user. Each request should show the application's identity so administrators can trace activity to the integration. If an entry shows only the user, record that gap and confirm with your Redmine version's documentation how application identity is logged before moving production traffic to the new grant.

Mapping existing API key integrations to OAuth2 applications

This table compares each existing Redmine API integration by its identity, the data it touches, the role permissions behind it, and its planned OAuth2 target. Read each row as one integration, and use the impersonation and header columns to spot the shared or administrator keys that should move first. The main takeaway is that the target grant types and scopes depend on the Redmine version you run, so confirm them on your installed release before you assign any application.

IntegrationCurrent identity and key typeData read or written, and role permissionsImpersonation or X-Redmine-API-Key headerTarget OAuth2 application, owner and token handling
Example: chat notification bot (illustrative)Shared administrator API key held in the bot's configuration fileReads issues and projects. Permissions inherited from an administrator role, far broader than the bot needsUses the X-Redmine-API-Key header. No impersonationSeparate application with a narrowed role, owned by the platform team. Tokens stored in a secrets manager and rotated on a defined schedule
Example: time entry export script (illustrative)Personal API key of a former employeeReads time entries for named projects. Permissions follow that user's project rolesUses the key as a request parameter. No impersonationRe-register under a service identity, owned by finance operations. Remove the personal key once the user account is deactivated
Example: CI status updater (illustrative)Dedicated service account keyWrites issue notes and status changes. Requires a role with issue editing in specific trackersUses the header. No impersonationApplication owned by the DevOps team with a write-scoped grant limited to its projects, if the installed version offers that scope
Example: reporting job run as another user (illustrative)Administrator key with X-Redmine-Switch-UserReads issues across all projects, acting as each named userImpersonation through X-Redmine-Switch-UserReview whether impersonation is still needed. Where it is, plan a dedicated application and record each approval
Email or import toolOften none, or basic authentication with a user passwordCreates issues from external records. Permissions depend on the mapped user's rolesBasic authentication, not an API keyMove off password-based access first, then assign a registered application with the minimum scopes its writes require
Vendor or third-party pluginKey supplied by the plugin's own configuration screenVaries by plugin. Confirm which resources and roles the plugin needsConfirm with the vendor whether it sends the header or a parameterCheck whether the plugin supports OAuth2 on your version before planning a change, and record any fallback to a shared key
Integration inventory and ownershipNot recorded in many environmentsLists resources touched and the roles that grant themRecord for each integration, including whether it impersonatesOwner, token lifetime, rotation and revocation steps recorded before cutover

Security controls for OAuth2 applications in Redmine

An OAuth2 application acts with the permissions of the user who authorized it, so its security depends on the account, the client secret, the redirect settings and the access list kept after go-live. The cards below cover the controls to set before moving an integration off shared API keys.

Choose the authorizing account carefully

The application inherits every permission of the user who grants access, including project memberships, role permissions and visibility on private issues. Authorizing an administrator or a long-standing personal account gives the integration far more reach than it needs. Create a dedicated service user, add it only to the projects the integration touches, and give it a role that allows only the actions the integration performs. Review that role whenever the integration's scope changes.

Store and rotate client secrets

A client secret held by a confidential application is as sensitive as a password, so keep it in a secrets manager or a restricted configuration store, never in source control or chat. Record who holds it and where it is deployed. Plan a rotation procedure that issues a new secret, updates the integration, and retires the old one, and rehearse it once in a non-production setup so the cutover does not stall a live integration.

Allow only HTTPS redirect URIs

The redirect URI is where Redmine sends the authorization code, so a loose value lets an attacker receive codes meant for the integration. Register exact HTTPS redirect URIs for each application, with no wildcards and no placeholder hosts left from testing. Confirm in your own environment how the Redmine version you run validates redirect URIs, and test that a mismatched URI is refused before you rely on the check.

Confirm token lifetime and revocation

Access tokens should be short-lived and refreshable, and revoking an application should stop its existing tokens from working. Check the token expiry and refresh behavior of your Redmine release against the REST API documentation, then test revocation with a real token: revoke it, then confirm the next API call fails. Document who can revoke an application and how that action is requested during an incident.

Review which applications hold access

Over time, applications accumulate authorizations from people who have since left the team or changed roles. Schedule a periodic review that lists each registered application, its owner, the user it acts as, and the projects it can reach. Compare that list with the integration inventory and revoke anything without a current owner. Confirm which of these views your Redmine version exposes to administrators and what must be exported manually.

Retire shared API keys after cutover

A shared API key stays valid until someone removes it, so it remains an open path after the integration has moved to OAuth2. Once each integration is confirmed on OAuth2, disable the old key for the account it used, check Redmine's API key settings for any leftover keys, and record the removal date. Keep a short list of integrations still on keys so the migration has a visible end point and does not drift.

Choosing a migration path for each kind of integration

Scripts and cron jobs run by the team are usually the simplest to move, because one person or group owns both the code and the schedule. The first question is whether each script authenticates as a named person or as a service identity. Many older scripts send a per-user key in the X-Redmine-API-Key header, so they break when that person leaves or changes role.

  • Effort driver: the number of scripts and how many depend on a key tied to a personal account. A short inventory is a small task, while scripts scattered across home directories and servers take longer to find and test.
  • Interactive authorization: not expected for unattended jobs, since nobody is present to approve a browser consent step. Confirm in the 6.1 documentation how an unattended job obtains its credential before you commit to a design.
  • Secrets location: move the credential out of the script and into the scheduler's secret store or a file readable only by the job user, with the path documented.
  • Temporary key use: keep an existing key only for scripts that are not yet inventoried, and record a removal date in the change ticket.

Before you change any credential, check which account each script runs under and confirm that every job has a named owner.

Why OAuth2 calls to Redmine fail and how to fix them

This table lists the failures most often seen when an application starts calling Redmine with OAuth2 tokens, with the likely cause, the check to run and the fix for each. Work down the rows in order, since the first few checks (URLs, headers, proxies) explain most failed authorizations and token calls.

Symptom or causeLikely causeCheck to runFix
Redirect URI mismatchThe redirect URI registered for the application differs from the one the client sends, including trailing slashes, ports or path case.Compare the registered URI in Redmine's application settings with the redirect_uri parameter in the authorization request, character for character.Register the exact callback URL the application uses, or update the application and client configuration so both match.
Public URL uses HTTP instead of HTTPSRedmine generates links and callbacks from the request scheme, so a TLS-terminating proxy that does not forward the original scheme makes Redmine build http:// URLs.Check the host setting in Redmine and the X-Forwarded-Proto header the proxy sends. Look at the URL in the authorization redirect.Set the proxy to forward the original scheme and host, and make the public URL in Redmine use https. Confirm with the Redmine installation guide for your deployment.
Reverse proxy strips the Authorization headerThe proxy drops or rewrites the Authorization header before the request reaches Redmine, so bearer tokens never arrive.Send a test request with a bearer token and log what Redmine receives. Compare with a direct request to the application server.Configure the proxy to pass the Authorization header through to Redmine, then retest the token call.
Expired or revoked tokenThe access token has passed its lifetime, the user revoked the grant, or the application was removed or re-registered.Inspect the 401 response and confirm the token's issue time and status in the user's authorized applications list.Refresh the token with the refresh grant if the application supports it, or repeat the authorization flow and store the new token.
User role lacks the permissionThe authorized user is authenticated but their role in the project does not grant the action, so Redmine returns 403 even though the token is valid.Check the user's role on the target project and the module and permission settings for that action, such as viewing or editing issues.Adjust the role or use a dedicated service account with only the permissions the integration needs, and retest.
Clock skew between serversToken issue and expiry times are checked against the server clock, so a Redmine host or application host drifting from real time makes valid tokens look expired or not yet valid.Compare the UTC time on the Redmine server, the application server and the authorization path, and check that time synchronization is running.Enable NTP or chrony on all hosts and resynchronize clocks before retrying the flow.
Application still sends X-Redmine-API-KeyThe integration was only partly migrated, so some calls still use the old shared key or the key is sent alongside the bearer token, and the old key may be disabled or belong to a removed account.Search the application code, CI jobs and cron scripts for X-Redmine-API-Key and key query parameters. Review server logs for calls without a bearer token.Replace every call with the OAuth2 token, remove the shared key from configuration and secrets stores, and then disable the old key.

Questions teams ask before moving Redmine integrations to OAuth2

How much effort does moving Redmine integrations to OAuth2 take?

No effort figure applies here, so the answer depends on your inventory. The main drivers are the number of integrations, whether each one has custom code that makes API calls, how client secrets are managed today, and how much testing each integration needs. A single script that reads issues is a small change. Several services that share one key, each with its own deployment pipeline and owner, take considerably longer. Ask for a written scope that lists each integration, its owner, the test plan and the cutover steps before you agree to any timeline.

Can an internal team move integrations to OAuth2 without outside help?

Yes, if the team has three things: someone who administers Redmine, an owner for each integration who can change its code and configuration, and a non-production Redmine for testing. The hardest part is often the inventory, because teams frequently discover scripts, pipelines and plugins that use a shared key only during the migration. Teams without a Redmine administrator or spare capacity during cutover often bring in outside help for planning and testing. Confirm your Redmine version first, because OAuth2 for API applications is available from Redmine 6.1 onward.

What does the migration need from our team?

The work depends more on access and people than on lead time. Plan for:

  • Redmine administrator access to register applications and review their permissions
  • An owner for each integration who knows its code, schedule and where its secrets live
  • Test accounts with the same roles the integrations use, plus a non-production Redmine
  • An agreed cutover window with affected users and a rollback path

Without these, testing tends to stall. Also confirm who approves retiring each shared key, because that decision usually belongs to a security owner rather than the integration team.

What does a fixed-scope engagement cover for OAuth2 work?

A fixed-scope engagement covers the work set out in an agreed written scope, and DeployOpen agrees scope, deliverables and timelines in writing before work starts. For this topic, ask whether the scope includes the integration inventory, registration of each application, changes so each client obtains and refreshes its own tokens, test runs, the cutover plan and documentation for the owners who run the integrations afterward. Also ask what is excluded, such as changes to third-party tools that call Redmine, and who maintains the result after handover.

Can we retire shared API keys in one step?

Usually not. A shared key often serves several integrations at once, so the safer path is to move one integration at a time, confirm that it works with its own authorization, and then disable the old key. Keep the shared key active until the inventory shows no remaining callers and your logs show it is no longer used. Plan a rollback for each step. Ask any provider how they will identify every caller of the old key before anything is disabled.

Which Redmine version do we need for OAuth2 API applications?

OAuth2 for API applications is available from Redmine 6.1. The Redmine download page lists 7.0.x as the fully supported line with new features, 6.1.x as receiving only bug fixes and security updates, 6.0.x as receiving only important security updates, and 5.1.x and older as unsupported. If you run 5.1 or older, plan the upgrade first. The upgrade guide describes copying configuration, uploads and third-party plugins to the new installation before running the migrations. Check plugin compatibility before you choose a target version.

What should a security review check in each OAuth2 application?

Review how each application stores its client credentials, which Redmine permissions it requests, and how its tokens are refreshed and revoked. Confirm that client secrets sit in a secrets store rather than in source repositories or cron files, that each application holds only the permissions it needs, and that redirect addresses are fixed and reviewed. Check that logs record which application made each call, so you can trace activity after cutover. Compare the new flow with the existing key methods described in the REST API documentation to confirm what changes for each integration.

How DeployOpen scopes and delivers Redmine OAuth2 integrations

DeployOpen plans and builds the move from shared Redmine API keys to OAuth2 authorization for applications that call the Redmine API. Each engagement is fixed-scope, with the applications, permissions, deliverables and handover agreed in writing before work starts.

How we scope

  • Inventory every integration that uses a shared API key, its owner and the Redmine resources it reads or writes.
  • Confirm your Redmine version and whether it is on the 6.1 line or later before any OAuth2 design work begins.
  • Agree in writing which applications move to OAuth2, which stay on keys for now, and the cutover order.

How we build

  • Register each application in Redmine, define its redirect URIs and scope its access to the minimum each integration needs.
  • Build or adjust the authorization flow and token handling in your integration code, with secrets kept out of source control.
  • Test the flow end to end in a staging Redmine, including token expiry, revocation and users without the required role.

How we hand over

  • Document each registered application, its owner, its permissions and the steps to rotate or revoke its credentials.
  • Provide a cutover runbook that lists the old shared keys to disable and the checks to confirm each integration still works.
  • Walk your administrators and developers through the registration and troubleshooting steps before the engagement closes.

How we support

  • Ongoing support, Redmine upgrades and continuous testing are available as retainers after handover.
  • Review new applications and permission changes against the agreed scope before they reach production.
  • Confirm with the Redmine release notes and your own environment how each upgrade affects registered applications.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.