2018-08-01 11:01:02 +02:00
---
title: Authorization
parent: Concepts
weight: 52
---
2024-11-05 11:41:56 +02:00
Authorization is handled separately for _ Direct Device Integration (DDI) API _ and _Device Management Federation (DMF)
API_ (where successful authentication includes full authorization) and _ Management API _ and _ UI _ which is based on
Spring
security [authorities ](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java ).
2018-08-01 11:01:02 +02:00
<!--more-->
2024-11-05 11:41:56 +02:00
However, keep in mind that hawkBit does not offer an off the shelf authentication provider to leverage these permissions
and the underlying multi user/tenant capabilities of hawkBit but it supports authentication providers offering an OpenID
Connect interface. Check out [Spring security documentation ](http://projects.spring.io/spring-security/ ) for further
information. In
hawkBit [SecurityAutoConfiguration ](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityAutoConfiguration.java )
is a good starting point for integration.
2018-08-01 11:01:02 +02:00
2024-11-05 11:41:56 +02:00
The default implementation is single user/tenant with basic auth and the logged in user is provided with all
permissions. Additionally, the application properties may be configured for multiple static users;
see [Multiple Users ](#multiple-users ) for details.
2018-08-01 11:01:02 +02:00
## DDI API
2021-02-08 16:56:50 +01:00
2018-08-01 11:01:02 +02:00
An authenticated target is permitted to:
2021-02-08 16:56:50 +01:00
2018-08-01 11:01:02 +02:00
- retrieve commands from the server
- provide feedback to the the server
- download artifacts that are assigned to it
2024-11-05 11:41:56 +02:00
A target might be permitted to download artifacts without authentication (if enabled, see above). Only the download can
be permitted to disable the authentication. This can be used in scenarios where the artifacts itself are e.g. signed and
secured.
2018-08-01 11:01:02 +02:00
## Management API and UI
2019-05-21 11:09:58 +02:00
### Multiple Users
2021-02-08 16:56:50 +01:00
2024-11-05 11:41:56 +02:00
hawkBit optionally supports configuring multiple static users through the application properties. In this case, the user
and password Spring security properties are ignored.
2019-05-21 11:09:58 +02:00
An example configuration is given below.
hawkbit.server.im.users[0].username=admin
hawkbit.server.im.users[0].password={noop}admin
hawkbit.server.im.users[0].firstname=Test
hawkbit.server.im.users[0].lastname=Admin
hawkbit.server.im.users[0].email=admin@test .de
hawkbit.server.im.users[0].permissions=ALL
hawkbit.server.im.users[1].username=test
hawkbit.server.im.users[1].password={noop}test
hawkbit.server.im.users[1].firstname=Test
hawkbit.server.im.users[1].lastname=Tester
hawkbit.server.im.users[1].email=test@tester .com
hawkbit.server.im.users[1].permissions=READ_TARGET,UPDATE_TARGET,CREATE_TARGET,DELETE_TARGET
2024-11-05 11:41:56 +02:00
A permissions value of `ALL` will provide that user with all possible permissions. Passwords need to be specified with
the used password encoder in brackets. In this example, `noop` is used as the plaintext encoder. For production use, it
is recommended to use a hash function designed for passwords such as * bcrypt * . See
this [blog post ](https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-format ) for more
information on password encoders in Spring Security.
2019-05-21 11:09:58 +02:00
2020-01-14 13:09:13 +01:00
### OpenID Connect
2021-02-08 16:56:50 +01:00
2024-11-05 11:41:56 +02:00
hawkbit supports authentication providers which use the OpenID Connect standard, an authentication layer built on top of
the OAuth 2.0 protocol.
2020-01-14 13:09:13 +01:00
An example configuration is given below.
spring.security.oauth2.client.registration.oidc.client-id=clientID
spring.security.oauth2.client.provider.oidc.issuer-uri=https://oidc-provider/issuer-uri
spring.security.oauth2.client.provider.oidc.jwk-set-uri=https://oidc-provider/jwk-set-uri
2024-11-05 11:41:56 +02:00
Note: at the moment only DEFAULT tenant is supported. By default the resource_access/<client id>/roles claim is mapped
2024-11-08 15:12:42 +02:00
to hawkBit permissions.
2023-11-03 14:52:31 +02:00
2018-08-01 11:01:02 +02:00
### Delivered Permissions
2021-02-08 16:56:50 +01:00
2023-03-27 14:12:23 +02:00
- READ_/UPDATE_/CREATE_/DELETE_TARGET for:
2024-11-05 11:41:56 +02:00
- Target entities including metadata (that includes also the installed and assigned distribution sets)
- Target tags
- Target actions
- Target registration rules
- Bulk operations
- Target filters
2018-08-01 11:01:02 +02:00
- READ_/UPDATE_/CREATE_/DELETE_REPOSITORY for:
2024-11-05 11:41:56 +02:00
- Distribution sets
- Software Modules
- Artifacts
- DS tags
2018-08-01 11:01:02 +02:00
- DOWNLOAD_REPOSITORY_ARTIFACT
2024-11-05 11:41:56 +02:00
- Permission to download artifacts of a software module (Note: READ_REPOSITORY allows only to read the metadata).
2018-08-01 11:01:02 +02:00
2025-06-13 13:19:35 +03:00
- READ_TARGET_SECURITY_TOKEN
- Permission to read the target security token. The security token is security concerned and should be protected.
- READ_TENANT_CONFIGURATION/TENANT_CONFIGURATION
- Permission to read/administrate the tenant settings.
2018-08-01 11:01:02 +02:00
2021-02-08 16:56:50 +01:00
- READ_/UPDATE_/CREATE_/DELETE_/HANDLE_/APPROVE_ROLLOUT for:
2024-11-05 11:41:56 +02:00
- Managing rollouts and provision targets through a rollout.
2018-08-01 11:01:02 +02:00
### Permission Matrix for example uses cases that need more than one permission
2023-02-01 15:18:30 +01:00
| Use Case | Needed permissions |
|----------------------------------------------------------------------------|----------------------------------------------------------------------------|
| Search _ targets _ by installed or assigned _ distribution set _ | READ_REPOSITORY, READ_TARGET |
| Assign _ DS _ to a _ target _ | READ_REPOSITORY, UPDATE_TARGET |
| Assign DS to target through a _ Rollout _ , i.e. _ Rollout _ creation and start | READ_REPOSITORY, READ_TARGET, READ_ROLLOUT, CREATE_ROLLOUT, HANDLE_ROLLOUT |
| Read _ Rollout _ status including its _ deployment groups _ | READ_REPOSITORY, READ_ROLLOUT |
| Checks _ targets _ inside _ Rollout deployment group _ | READ_REPOSITORY, READ_TARGET, READ_ROLLOUT |
2018-08-01 11:01:02 +02:00
## Device Management Federation API
2021-02-08 16:56:50 +01:00
2024-11-05 11:41:56 +02:00
The provided _ RabbitMQ _ [vhost and user ](https://www.rabbitmq.com/access-control.html ) should be provided with the
necessary permissions to send messages to hawkBit through the exchange and receive messages from it through the
specified queue.