Skip to content

How to obtain values used in 'ApplicationSecret'? #426

Closed Answered by banool
Jasperav asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone stumbling upon this later, here is how I did it.

Let's say you want to support either loading up an authenticator from the default environment, or from an explicit service account JSON file. We don't bother with ApplicationSecret like is used in the example code. First, add some configuration to load up a service account JSON:

struct MyConfig {
    /// If given, we will use this service account to authenticate instead of the
    /// default authentication method. This must a JSON key for the service account,
    /// encoded in base64.
    service_account_json_base_64: Option<String>,
}

impl MyConfig {
    fn service_account_json(&self) -> Result<Option<String>> {
        Ok(self

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Jasperav
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #425 on April 18, 2023 10:40.