ockam icon indicating copy to clipboard operation
ockam copied to clipboard

auth0 command - read configuration details from env and config file

Open adrianbenavides opened this issue 2 years ago • 0 comments

Related PR: https://github.com/build-trust/ockam/pull/2995

We need to add a new section to the ockam_command/ockam.toml file to define the auth0 config values used at ockam_command/src/enroll/auth0.rs:79 (except for SCOPES):

impl Auth0Service {
    const DOMAIN: &'static str = "dev-w5hdnpc2.us.auth0.com";
    const CLIENT_ID: &'static str = "sGyXBwQfU6fjfW1gopphdV9vCLec060b";
    const API_AUDIENCE: &'static str = "https://dev-w5hdnpc2.us.auth0.com/api/v2/";
    const SCOPES: &'static str = "profile openid email";
}

The ockam.toml section could look like:

[auth0]
domain = "id.region.auth0.com"
client_id = "id"

We can derive API_AUDIENCE from the DOMAIN value.

We should be able to build an Auth0Config struct reading the values from the ockam.toml file and env variables, giving priority to the latter, and then use it in the auth0 command.

adrianbenavides avatar Jul 19 '22 17:07 adrianbenavides