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 register client apps (Axon Server EE only)
  • Mandatory parameters
  • Optional parameters
  1. Axon Server
  2. 安全

访问控制 - 客户端应用程序

Access Control - Client Applications

上一页访问控制 - 企业版下一页访问控制 - 命令行

最后更新于2年前

Applications need to provide a valid token before they can perform all operations. The access token can be setup in the client using the property axon.axonserver.token=<token>. The Axon Server connector will use this to authenticate the client to the server.

Using the CLI to register client apps (Axon Server EE only)

In Axon Server EE, instead of , you must register applications with specific roles. Please do note that you'll need either a user with ADMIN level access to do this in the UI, or access to the system token for use with the CLI.

To register an application and get an access token use the "register-application" command. This command will return the token to use, which can be specified on the commandline, or generated by Axon Server. Note that this token is only generated once; if you lose it you must delete the application and register it again to get a new token. The command register-application has several options:

$ java -jar axonserver-cli.jar register-application
usage: register-application
 -a,--application <arg>    Name of the application
 -d,--description <arg>    [Optional] Description of the application
 -i,--insecure-ssl         Do not check the certificate when connecting
                           using HTTPS.
 -o,--output <arg>         Output format (txt,json)
 -prop,--property <arg>    [Optional] properties for a context/application
                           (specify as name=value)
 -r,--roles <arg>          Roles for the application, use role@context
 -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
 -T,--token <arg>          use this token for the app
Error processing command 'register-application': Invalid command

Mandatory parameters

  • -a or --application specifies the name of the application.

  • -r or --roles specifies the roles of the application. Specify multiple roles by giving a comma separated list, e.g. "READ,ADMIN".

Optional parameters

  • -d or --description specifies a description of the application, which will be shown in overviews.

  • -T or --token can be used to specify the token you want to use for a newly registered application.

  • -prop or --property adds an application specific property. These properties will be provided to any plugin processing messages from/for that application.

  • -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.

The ADMIN role is only valid for the _admin context, the other roles are specific to another context. In addition to the role name you can also supply the context to which this role applies, for example {role_name}@{context_name}. Also if no context is mentioned in Axon Server EE, the role is granted to the application for all registered contexts, including contexts that are created after the role has been granted.

The token that you set here must be used by all Axon Framework Applications connecting to Axon Server. The access token can be setup in the client using the property axon.axonserver.token=[Token]

If you are using the REST APIs, you can specify the token in the HTTP requests via the following header:

AxonIQ-Access-Token: my-token-value-here

-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.

setting a single token in axonserver.properties
the (admin) token set in the properties