Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nss-pam-webapi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
magicfelix
nss-pam-webapi
Commits
000213ee
Verified
Commit
000213ee
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
[OAuth] return toke nresponse for password flow
parent
48961330
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/oauth.rs
+2
-2
2 additions, 2 deletions
src/oauth.rs
with
2 additions
and
2 deletions
src/oauth.rs
+
2
−
2
View file @
000213ee
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment