Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp-module-authoauth2
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp-module-authoauth2
Commits
0cebe5a0
Commit
0cebe5a0
authored
5 years ago
by
Patrick Radtke
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
3b3846e3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/lib/Auth/Source/OAuth2Test.php
+3
-1
3 additions, 1 deletion
tests/lib/Auth/Source/OAuth2Test.php
tests/lib/Auth/Source/OpenIDConnectTest.php
+30
-6
30 additions, 6 deletions
tests/lib/Auth/Source/OpenIDConnectTest.php
with
33 additions
and
7 deletions
tests/lib/Auth/Source/OAuth2Test.php
+
3
−
1
View file @
0cebe5a0
...
...
@@ -204,7 +204,9 @@ class OAuth2Test extends \PHPUnit_Framework_TestCase
'authenticatedApiRequests'
=>
[
'https://mock.com/v1.0/me/memberOf'
],
],
new
AccessToken
([
'access_token'
=>
'stubToken'
]),
new
AccessToken
([
'access_token'
=>
'stubToken'
,
]),
[
'test.name'
=>
[
'Bob'
],
'test.additionalResource'
=>
[
'info'
]],
]
];
...
...
This diff is collapsed.
Click to expand it.
tests/lib/Auth/Source/OpenIDConnectTest.php
+
30
−
6
View file @
0cebe5a0
...
...
@@ -4,8 +4,6 @@ namespace Test\SimpleSAML\Auth\Source;
use
CirrusIdentity\SSP\Test\Capture\RedirectException
;
use
CirrusIdentity\SSP\Test\MockHttp
;
use
League\OAuth2\Client\Provider\AbstractProvider
;
use
League\OAuth2\Client\Provider\GenericResourceOwner
;
use
League\OAuth2\Client\Token\AccessToken
;
use
SimpleSAML\Configuration
;
use
SimpleSAML\Module\authoauth2\Auth\Source\OpenIDConnect
;
...
...
@@ -27,10 +25,10 @@ class OpenIDConnectTest extends OAuth2Test
public
static
function
setUpBeforeClass
()
{
putenv
(
'SIMPLESAMLPHP_CONFIG_DIR='
.
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/config'
);
// Some of the constructs in this test cause a Configuration to be created prior to us
// setting the one we want to use for the test.
Configuration
::
clearInternalState
();
}
// Some of the constructs in this test cause a Configuration to be created prior to us
// setting the one we want to use for the test.
Configuration
::
clearInternalState
();
}
public
function
finalStepsDataProvider
()
{
return
[
...
...
@@ -55,6 +53,32 @@ class OpenIDConnectTest extends OAuth2Test
];
}
public
function
finalStepsDataProviderWithAuthenticatedApiRequest
()
{
return
[
[
[
'providerClass'
=>
MockOAuth2Provider
::
class
,
'attributePrefix'
=>
'test.'
,
'retryOnError'
=>
1
,
'authenticatedApiRequests'
=>
[
'https://mock.com/v1.0/me/memberOf'
],
],
new
AccessToken
([
'access_token'
=>
'stubToken'
,
'id_token'
=>
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiYXVkIjoidGVzdCBjbGllbnQgaWQiLCJpYXQiOjE1MTYyMzkwMjJ9.emHrAifV1IyvmTXh3lYX0oAFqqZInhDlclIlTUumut0'
,
]),
[
'test.name'
=>
[
'Bob'
],
'test.additionalResource'
=>
[
'info'
],
'test.id_token.sub'
=>
[
'1234567890'
],
'test.id_token.iat'
=>
[
1516239022
],
'test.id_token.aud'
=>
[
'test client id'
],
],
]
];
}
public
function
authenticateDataProvider
()
{
MockOpenIDConnectProvider
::
setConfig
([
...
...
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