Skip to content

review resource, scopes & permissions for TokenCredentials #61

Closed
@ctaggart

Description

@ctaggart

My first thought was that resource should be a list of scopes instead to match Microsoft Authentication Library MSAL v2, but I'm not sure.

/// Represents a credential capable of providing an OAuth token.
#[async_trait::async_trait]
pub trait TokenCredential {
    /// Gets a `TokenResponse` for the specified resource
    async fn get_token(&self, resource: &str) -> Result<TokenResponse, AzureError>;
}

My guess is that resource here is modeled after he az command line and is the resource identifier. I think it becomes the scope query param. In MSAL v2, it is a space delimited list.

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions