unilim-cas 1.0.1

A purrfect CAS authentication wrapper for Unilim.
Documentation
use serde::{Deserialize, Serialize};

/// oauth2 client configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OAuth2 {
    /// `client_id` of the oauth2 client.
    pub identifier: String,
    /// `redirect_uri` the portal sends the authorization code back to.
    pub callback: String,
    /// requested scopes, like `openid`, `profile` and `email`.
    pub scopes: Vec<String>,
}

impl OAuth2 {
    pub fn new(
        identifier: impl Into<String>,
        callback: impl Into<String>,
        scopes: Vec<String>,
    ) -> Self {
        Self {
            identifier: identifier.into(),
            callback: callback.into(),
            scopes,
        }
    }
}