ramosbugs / oauth2-rs

Extensible, strongly-typed Rust OAuth2 client library
Apache License 2.0
939 stars 163 forks source link

How to add two scopes to google oauth 2 #249

Closed HosMercury closed 9 months ago

HosMercury commented 9 months ago

I am trying to add two scopes to google It does not work

    pub fn authorize_url(&self) -> (Url, CsrfToken) {
        let scopes = vec![
            Scope::new("https://www.googleapis.com/auth/userinfo.email".to_string()),
            Scope::new("https://www.googleapis.com/auth/userinfo.profile".to_string()),
        ];

        self.client
            .authorize_url(CsrfToken::new_random)
            .add_scopes(scopes.iter().cloned())
            .url()
    }

I do not have any rust errors but the error from google the redirect uri is not match I am sure it matches

HosMercury commented 9 months ago

found the issue .. it was the link