Skip to content
Snippets Groups Projects
Verified Commit 000213ee authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

[OAuth] return toke nresponse for password flow

parent 48961330
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,7 @@ pub fn get_access_token<E: Copy>(conf: Config, prefix: &str, error_value: E, una ...@@ -95,7 +95,7 @@ pub fn get_access_token<E: Copy>(conf: Config, prefix: &str, error_value: E, una
} }
} }
pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: String, password: String, error_value: E, unauth_value: E) -> Result<String, E> { pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: String, password: String, error_value: E, unauth_value: E) -> Result<BasicTokenResponse, E> {
let scopes: Vec<&str> = get_or_error(&conf, &full_key(prefix, "scopes"), error_value)?; let scopes: Vec<&str> = get_or_error(&conf, &full_key(prefix, "scopes"), error_value)?;
let res_username = ResourceOwnerUsername::new(username); let res_username = ResourceOwnerUsername::new(username);
...@@ -109,7 +109,7 @@ pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: ...@@ -109,7 +109,7 @@ pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username:
let result = request.request(http_client); let result = request.request(http_client);
match result { match result {
Ok(t) => Ok("".to_string()), Ok(t) => Ok(t),
Err(e) => match e { Err(e) => match e {
RequestTokenError::ServerResponse(t) => { RequestTokenError::ServerResponse(t) => {
error!("Authorization server returned error: {}", t); error!("Authorization server returned error: {}", t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment