Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openid_connect
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
project
openid_connect
Commits
e9a6f686
Commit
e9a6f686
authored
1 year ago
by
Stefan Auditor
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Issue
#3395838
by sanduhrs: Update code style"
This reverts commit
eb93fc3c
.
parent
eb93fc3c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/OpenIDConnectClientBase.class.php
+4
-10
4 additions, 10 deletions
includes/OpenIDConnectClientBase.class.php
includes/openid_connect.forms.inc
+1
-1
1 addition, 1 deletion
includes/openid_connect.forms.inc
includes/openid_connect.pages.inc
+1
-1
1 addition, 1 deletion
includes/openid_connect.pages.inc
with
6 additions
and
12 deletions
includes/OpenIDConnectClientBase.class.php
+
4
−
10
View file @
e9a6f686
...
@@ -65,7 +65,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
...
@@ -65,7 +65,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
getSetting
(
$key
,
$default
=
NULL
)
{
public
function
getSetting
(
$key
,
$default
=
NULL
)
{
return
$this
->
settings
[
$key
]
?:
$default
;
return
isset
(
$this
->
settings
[
$key
]
)
?
$this
->
settings
[
$key
]
:
$default
;
}
}
/**
/**
...
@@ -119,10 +119,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
...
@@ -119,10 +119,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
'client_id'
=>
$this
->
getSetting
(
'client_id'
),
'client_id'
=>
$this
->
getSetting
(
'client_id'
),
'response_type'
=>
'code'
,
'response_type'
=>
'code'
,
'scope'
=>
$scope
,
'scope'
=>
$scope
,
'redirect_uri'
=>
url
(
$redirect_uri
,
array
(
'redirect_uri'
=>
url
(
$redirect_uri
,
array
(
'absolute'
=>
TRUE
,
'language'
=>
LANGUAGE_NONE
)),
'absolute'
=>
TRUE
,
'language'
=>
LANGUAGE_NONE
,
)),
'state'
=>
openid_connect_create_state_token
(),
'state'
=>
openid_connect_create_state_token
(),
),
),
);
);
...
@@ -142,10 +139,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
...
@@ -142,10 +139,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
'code'
=>
$authorization_code
,
'code'
=>
$authorization_code
,
'client_id'
=>
$this
->
getSetting
(
'client_id'
),
'client_id'
=>
$this
->
getSetting
(
'client_id'
),
'client_secret'
=>
$this
->
getSetting
(
'client_secret'
),
'client_secret'
=>
$this
->
getSetting
(
'client_secret'
),
'redirect_uri'
=>
url
(
$redirect_uri
,
array
(
'redirect_uri'
=>
url
(
$redirect_uri
,
array
(
'absolute'
=>
TRUE
,
'language'
=>
LANGUAGE_NONE
)),
'absolute'
=>
TRUE
,
'language'
=>
LANGUAGE_NONE
,
)),
'grant_type'
=>
'authorization_code'
,
'grant_type'
=>
'authorization_code'
,
);
);
$request_options
=
array
(
$request_options
=
array
(
...
@@ -180,7 +174,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
...
@@ -180,7 +174,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
decodeIdToken
(
$id_token
)
{
public
function
decodeIdToken
(
$id_token
)
{
[
$headerb64
,
$claims64
,
$signatureb64
]
=
explode
(
'.'
,
$id_token
);
list
(
$headerb64
,
$claims64
,
$signatureb64
)
=
explode
(
'.'
,
$id_token
);
$claims64
=
str_replace
(
array
(
'-'
,
'_'
),
array
(
'+'
,
'/'
),
$claims64
);
$claims64
=
str_replace
(
array
(
'-'
,
'_'
),
array
(
'+'
,
'/'
),
$claims64
);
$claims64
=
base64_decode
(
$claims64
);
$claims64
=
base64_decode
(
$claims64
);
return
drupal_json_decode
(
$claims64
);
return
drupal_json_decode
(
$claims64
);
...
...
This diff is collapsed.
Click to expand it.
includes/openid_connect.forms.inc
+
1
−
1
View file @
e9a6f686
...
@@ -103,7 +103,7 @@ function openid_connect_connect_form($form, &$form_state, $account) {
...
@@ -103,7 +103,7 @@ function openid_connect_connect_form($form, &$form_state, $account) {
* Connect the current user's Drupal account to an external provider.
* Connect the current user's Drupal account to an external provider.
*/
*/
function
openid_connect_connect_form_submit
(
&
$form
,
&
$form_state
)
{
function
openid_connect_connect_form_submit
(
&
$form
,
&
$form_state
)
{
[
$op
,
$client_name
]
=
explode
(
'__'
,
$form_state
[
'triggering_element'
][
'#name'
],
2
);
list
(
$op
,
$client_name
)
=
explode
(
'__'
,
$form_state
[
'triggering_element'
][
'#name'
],
2
);
if
(
$op
===
'disconnect'
)
{
if
(
$op
===
'disconnect'
)
{
openid_connect_disconnect_account
(
$form_state
[
'account'
],
$client_name
);
openid_connect_disconnect_account
(
$form_state
[
'account'
],
$client_name
);
...
...
This diff is collapsed.
Click to expand it.
includes/openid_connect.pages.inc
+
1
−
1
View file @
e9a6f686
...
@@ -46,7 +46,7 @@ function openid_connect_redirect_page($client_name) {
...
@@ -46,7 +46,7 @@ function openid_connect_redirect_page($client_name) {
// Any other error should be logged. E.g. invalid scope.
// Any other error should be logged. E.g. invalid scope.
$variables
=
array
(
$variables
=
array
(
'@error'
=>
$_GET
[
'error'
],
'@error'
=>
$_GET
[
'error'
],
'@details'
=>
$_GET
[
'error_description'
]
?:
t
(
'None'
),
'@details'
=>
isset
(
$_GET
[
'error_description'
]
)
?
$_GET
[
'error_description'
]
:
t
(
'None'
),
);
);
watchdog
(
'openid_connect_'
.
$client_name
,
'Authorization failed: @error. Details: @details'
,
$variables
,
WATCHDOG_ERROR
);
watchdog
(
'openid_connect_'
.
$client_name
,
'Authorization failed: @error. Details: @details'
,
$variables
,
WATCHDOG_ERROR
);
}
}
...
...
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