Skip to content

StandardTokenResponse does not support twitch oauth response #269

@SarthakSingh31

Description

@SarthakSingh31

From dev.twitch.tv.

{
  "access_token": "rfx2uswqe8l4g1mkagrvg5tv0ks3",
  "expires_in": 14124,
  "refresh_token": "5b93chm6hdve3mycz05zfzatkfdenfspp1h1ar2xxdalen01",
  "scope": [
    "channel:moderate",
    "chat:edit",
    "chat:read"
  ],
  "token_type": "bearer"
}

The oauth response returns an array of scopes instead of a space delimited string of scopes.
The StandardTokenResponse only supports the space delimited string of scopes. It would be very useful if it supported both.

oauth2-rs/src/token/mod.rs

Lines 611 to 616 in 30ced32

#[serde(rename = "scope")]
#[serde(deserialize_with = "crate::helpers::deserialize_space_delimited_vec")]
#[serde(serialize_with = "crate::helpers::serialize_space_delimited_vec")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
scopes: Option<Vec<Scope>>,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions