Axon 参考指南
  • 介绍
  • 架构概览
    • DDD & CQRS 概念
    • 事件溯源
    • 事件驱动的微服务
  • Axon Server
  • 发行说明
    • Axon Framework
      • Major Releases
      • Minor Releases
    • Axon Server
      • Major Releases
      • Minor Releases Standard Edition
      • Minor Releases Enterprise Edition
    • Axon Framework Extensions
      • AMQP
        • Major Releases
      • CDI
        • Major Releases
      • JGroups
        • Major Releases
      • Kafka
        • Major Releases
        • Minor Releases
      • Kotlin
        • Experimental Releases
      • Mongo
        • Major Releases
        • Minor Releases
      • Reactor
        • Major Releases
        • Minor Releases
      • Spring Cloud
        • Major Releases
        • Minor Releases
      • Tracing
        • Major Releases
        • Minor Releases
  • Getting Started
    • 快速开始
  • Axon Framework
    • 介绍
    • 消息传递概念
      • 消息剖析
      • 消息关联
      • 消息拦截
      • 支持带注解的处理程序
      • 异常处理
      • 工作单元
    • 命令
      • 建模
        • 聚合
        • 多实体聚合
        • 聚合状态存储
        • 从另一个聚合创建聚合
        • 聚合多态性
        • 解决冲突
      • 命令调度器
      • 命令处理程序
      • 基础设施
      • 配置
    • 事件
      • 事件调度器
      • 事件处理程序
      • 事件处理器
        • 订阅事件处理器
        • 流式事件处理器
      • 事件总线和事件存储
      • 事件版本控制
    • 查询
      • 查询处理
      • 查询调度器
      • 查询处理程序
      • 实现
      • 配置
    • 长时处理过程(Sagas)
      • 实现
      • 关联
      • 基础设施
    • Deadlines
      • Deadline Managers
      • Event Schedulers
    • 测试
      • 命令 / 事件
      • 长时处理过程(Sagas)
    • 序列化
    • 调整
      • 事件快照
      • 事件处理
      • 命令处理
    • 监控和指标
    • Spring Boot 集成
    • 模块
  • Axon Server
    • 介绍
    • 安装
      • 本地安装
        • Axon Server SE
        • Axon Server EE
      • Docker / K8s
        • Axon Server SE
        • Axon Server EE
    • 管理
      • 配置
        • System Properties
        • Command Line Interface
        • REST API
        • GRPC API
      • Monitoring
        • Actuator Endpoints
        • gRPC Metrics
        • Heartbeat Monitoring
      • Clusters
      • Replication Groups
      • Multi-Context
      • Tagging
      • Backup and Messaging-only Nodes
      • Backups
      • Recovery
      • Plugins
      • Error Codes
    • 安全
      • SSL
      • 访问控制
      • 访问控制 - 标准版
      • 访问控制 - 企业版
      • 访问控制 - 客户端应用程序
      • 访问控制 - 命令行
      • 访问控制 - REST API
      • 访问控制 - LDAP
      • 访问控制 - OAuth 2.0
    • 性能
      • 事件段
      • 流量控制
    • 迁移
      • Standard to Enterprise Edition
      • Non-Axon Server to Axon Server
  • Extensions
    • Spring AMQP
    • JGroups
    • Kafka
    • Kotlin
    • Mongo
    • Reactor
      • Reactor Gateways
    • Spring Cloud
    • Tracing
  • Appendices
    • A. RDBMS Tuning
    • B. Message Handler Tuning
      • 参数解析器
      • 处理程序增强
    • C. 元数据注解
    • D. 标识符生成
    • E. Axon Server Query Language
由 GitBook 提供支持
在本页
  • Using the CLI to create a user
  • Mandatory parameters
  • Optional parameters
  1. Axon Server
  2. 安全

访问控制

Access Control

上一页SSL下一页访问控制 - 标准版

最后更新于2年前

As Axon Server is an event store and may contain sensitive data it is always a good practice to enable access control in production and production-like environments. Enabling access control will require applications to provide a token when accessing Axon Server services (both through gRPC and HTTP), and require users to login to the dashboard.‌ In this section we will describe how to configure access control on both the Axon Server side as well as the Axon Framework side.

To enable access control in Axon Server (SE/EE) add the following property to axonserver.properties:

axoniq.axonserver.accesscontrol.enabled=true

Because Axon Server SE deals with this differently than Axon Server EE, they will be addresses separately:

For Axon Server EE, we have additional sections on the external authentication extensions:

Using the CLI to create a user

If you haven't used the cluster template to create an initial user, you can use the CLI to create it. For this you will need an admin-level access token, as described . To do this execute the "register-user" command:

$ java -jar axonserver-cli.jar register-user
usage: register-user
 -i,--insecure-ssl         Do not check the certificate when connecting
                           using HTTPS.
    --no-password          [Optional] Create a (locked) user account
                           without a password.
 -o,--output <arg>         Output format (txt,json)
 -p,--password <arg>       [Optional] Password for the user
 -r,--roles <arg>          [Optional] roles for the user
 -S,--server <arg>         Server to send command to (default
                           http://localhost:8024)
 -s,--https                Use HTTPS to connect to the server, rather than
                           HTTP.
 -t,--access-token <arg>   [Optional] Access token to authenticate at
                           server
 -u,--username <arg>       Username

Mandatory parameters

  • -u or --username specifies the username.

  • -r or --roles specifies the role of the user. Specify multiple roles by giving a comma separated list (without spaces), for example "READ,ADMIN".

Optional parameters

  • -p or --password specifies the password of the user. If you do not specify a password with the "-p" option, the command line interface will prompt you for one. If you instead want a use account without a password‌, for example when using Google OAuth2 authentication, use "--no-password".

  • --no-password will cause the CLI to create a user acount with no password set, which means you cannot login unless you use an external authentication provider.

  • -S or --server can be used to specify the URL to the server that the command needs to be sent to. If this is not supplied it connects to "http://localhost:8024" by default.

  • -s or --https will cause the CLI to use TLS, in effect changing the URL to "https://localhost:8024". Note that if you also want to change the port, you'll have to use "-S", in which case you can leave out "-s".

  • -i or --insecure-ssl will tell the CLI that Axon Server is using a certificate which is not signed by a known CA, for example when using self-signed certificates.

-t or --access-token specifies the access token to authenticate at the server to which the command is sent to. For SE this should be the same as . For EE this should be the security token discussed above.

Users can also be added using the REST API / UI Console that Axon Server SE provides. The CLI also allows the capabilities to as well as .

the (admin) token set in the properties
here
Axon Server EE
Axon Framework apps
Direct access to the REST and gRPC APIs
LDAP Extension
Axon Server SE
list all users
delete specific users
Axon Server CLI
OAuth2 Extension