Uptime Kuma
Uptime Kuma
This integration guide is community supported. It's not guaranteed to be complete, accurate, or up-to-date. It's likely that if this integration guide does not work for you that changes occurred with a third-party application.
Important Note: This documentation is version specific. Make sure you check the section outlining the tested versions.
Important Note: We always recommend users read the third-party documentation as part of the integration process to ensure configuration elements matches their needs. As such the See Also section is likely to have important links.
Important Note: If you find an error in this documentation please make a Pull Request, start a Discussion, or contact us on a Chat Room.
Tested Versions
Before You Begin
Important Reading
This section contains important elements that you should carefully consider before configuration of an OpenID Connect 1.0 Registered Client.
Common Notes
- The OpenID Connect 1.0
client_id
parameter:- This must be a unique value for every client.
- The value used in this guide is merely for readability and demonstration purposes and you should not use this value in production and should instead utilize the How do I generate a client identifier or client secret? FAQ. We recommend 64 random characters but you can use any arbitrary value that meets the other criteria.
- This must only contain RFC3986 Unreserved Characters.
- This must be no more than 100 characters in length.
- The OpenID Connect 1.0
client_secret
parameter:- The value used in this guide is merely for demonstration purposes and you should absolutely not use this value in production and should instead utilize the How do I generate a client identifier or client secret? FAQ.
- This string may be stored as plaintext in the Authelia configuration but this behaviour is deprecated and is not guaranteed to be supported in the future. See the Plaintext guide for more information.
- When the secret is stored in hashed form in the Authelia configuration (heavily recommended), the cost of hashing can, if too great, cause timeouts for clients. See the Tuning the work factors guide for more information.
- The configuration example for Authelia:
- Only contains an example configuration for the client registration and you MUST also configure the required elements from the OpenID Connect 1.0 Provider Configuration guide.
- Only contains a small portion of all of the available options for a registered client and users may wish to configure portions that are not part of this guide or configure them differently, as such it’s important to both familiarize yourself with the other options available and the effect of each of the options configured in this section by looking at the OpenID Connect 1.0 Clients Configuration guide.
Assumptions
This example makes the following assumptions:
- Application Root URL:
https://uptime-kuma.example.com/
- Authelia Root URL:
https://auth.auth.example.com/
- Client ID:
uptime-kuma
- Client Secret:
insecure_secret
- Secured Resource URL:
https://application.example.com/
Some of the values presented in this guide can automatically be replaced with documentation variables.
Important Notes
This implementation has several facets which must be configured as a security precaution. It’s advised people read the OAuth 2.0 Bearer Token Usage integration guide in addition to this guide to properly understand this process.
For example this guide has a requirement to adapt a fairly new and special section of Authelia. It’s important to take the time to understand it before you attempt to do it. Some notes about this are below.
- The
implementation
value of the server authz endpoints section must be the appropriate implementation for your proxy. - The
endpoint_name
in the server authz endpoints section is the actual name of the endpoint which must be configured in your proxy for the Forwarded / Redirected Authorization Flow:- You can customize this name but by configuring just one all other default endpoints for authorization are removed
such as
/api/verify
,/api/authz/forward-auth
, etc. - The name represents the endpoint path, for example setting
endpoint_name
will configure an endpoint at/api/authz/endpoint_name
.
- You can customize this name but by configuring just one all other default endpoints for authorization are removed
such as
- The use of the
HeaderAuthorization
strategy and how it’s configured here accepts bearer tokens in the Authorization header as one of the possible ways to authenticate, but still allows cookie-based authorization.
See more information about the server authz endpoints section in the Configuration Guide and Reference Guide.
Configuration
Authelia
The following YAML configuration is an example Authelia client configuration for use with Uptime Kuma which will operate with the above example:
Notes:
- The configuration has a requested_audience_mode value of
implicit
which is used to automatically grant all audiences the client is permitted to request, the default isexplicit
which does not do this and the client must also request the audience using theaudience
form parameter. As Uptime Kuma does not currently support this configuration is required. - The
audience
(or multiple) is the endpoints of the secured resource you want to monitor using Uptime Kuma. - The
oauth2:client:uptime-kuma
is a special subject which refers to theuptime-kuma
client id and allows Access Tokens granted via the Client Credentials Flow to be used provided they were granted to this client.
Application
To configure Uptime Kuma to utilize Authelia as an OpenID Connect 1.0 Provider:
- Create a new status monitor or configure an existing one
- Choose monitor type e.g. HTTP(s) Keyword and set a keyword you want to find
- Set the URL to be monitored (this corresponds to the
audience
parameter in Authelia) - Configure Authentication as follows:
- Method: OAuth2: Client Credentials
- Authentication Method: Authorization Header
- OAuth Token URL:
https://auth.example.com/api/oidc/token
- Client ID:
uptime-kuma
- Client Secret:
insecure_secret
- OAuth Scope:
authelia.bearer.authz
See the following screenshot for an authentication example of the above: