设置Dashboard的环境(前端)
rmf-web\packages\dashboard.env

# because we are a monorepo, some create-react-app dependencies may be installed in the root directory,
# it complains if it find such packages so we need to disable the check.
SKIP_PREFLIGHT_CHECK=true

REACT_APP_TRAJECTORY_SERVER=ws://localhost:8006
REACT_APP_RMF_SERVER=http://localhost:8000
# 下面设置两个,如果不需要login则关闭
REACT_APP_AUTH_PROVIDER="keycloak"
REACT_APP_KEYCLOAK_CONFIG={"realm":"rmf","clientId":"myclient","url":"http://localhost:8080/"}

设置api-server
packages\api-server\api_server\default_config.py

设置其中的iss、jwt_public_key、aud

# pylint: disable=line-too-long
config = {
    # ip or hostname to bind the socket to, this only applies when running the server in
    # standalone mode.
    "host": "127.0.0.1",
    # port to bind to, this only applies when running the server in standalone mode.
    "port": 8000,
    "db_url": "sqlite://:memory:",
    # url that rmf-server is being served on.
    # When being a proxy, this must be the url that rmf-server is mounted on.
    # E.g. https://example.com/rmf/api/v1
    "public_url": "http://localhost:8000",
    "static_directory": "static",  # The directory where static files should be stored.
    "log_level": "WARNING",  # https://docs.python.org/3.8/library/logging.html#levels
    # a user that is automatically given admin privileges, note that this does not guarantee that the user exists in the identity provider.
    "builtin_admin": "admin",
    # path to a PEM encoded RSA public key which is used to verify JWT tokens, if the path is relative, it is based on the working dir.
    "jwt_public_key": "/home/rmf/rmf-web/packages/api-server/api_server/test.pub",
    # url to the oidc endpoint, used to authenticate rest requests, it should point to the well known endpoint, e.g.
    # http://localhost:8080/auth/realms/rmf-web/.well-known/openid-configuration.
    # NOTE: This is ONLY used for documentation purposes, the "jwt_public_key" will be the
    # only key used to verify a token.
    "oidc_url": "None",
    # Audience the access token is meant for. Can also be an array.
    # Used to verify the "aud" claim.
    "aud": ["rmf_api_server","myclient", "account"],
    # url or string that identifies the entity that issued the jwt token
    # Used to verify the "iss" claim
    # If iss is set to None, it means that authentication should be disabled
    "iss": "http://localhost:8080/realms/rmf",
    # list of arguments passed to the ros node, "--ros-args" is automatically prepended to the list.
    # e.g.
    #   Run with sim time: ["-p", "use_sim_time:=true"]
    "ros_args": [],
}