ramosbugs / oauth2-rs

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

what is the appropriate way. to add two scopes to google OAuth #250

Closed HosMercury closed 9 months ago

HosMercury commented 9 months ago
        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 am doing it that way but it sometimes works, sometimes I get redirect_uri_mismatch then if I commented on one of the scope the response has no error but does not satisfy my scopes.

is there any example of Google OAuth?