Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
5a137e6d
Commit
5a137e6d
authored
Dec 24, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OpenId client refactor in progress.
parent
b2f3bed6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
5 deletions
+49
-5
AuthAction.php
extensions/yii/authclient/AuthAction.php
+1
-5
OpenId.php
extensions/yii/authclient/OpenId.php
+0
-0
OpenIdTest.php
tests/unit/extensions/authclient/OpenIdTest.php
+48
-0
No files found.
extensions/yii/authclient/AuthAction.php
View file @
5a137e6d
...
...
@@ -206,7 +206,7 @@ class AuthAction extends Action
$attributes
=
array
(
'id'
=>
$provider
->
identity
);
$rawAttributes
=
$provider
->
get
Attributes
();
$rawAttributes
=
$provider
->
fetch
Attributes
();
foreach
(
$provider
->
requiredAttributes
as
$openIdAttributeName
)
{
if
(
isset
(
$rawAttributes
[
$openIdAttributeName
]))
{
$attributes
[
$openIdAttributeName
]
=
$rawAttributes
[
$openIdAttributeName
];
...
...
@@ -229,10 +229,6 @@ class AuthAction extends Action
}
}
else
{
//$provider->identity = $provider->authUrl; // Setting identifier
$request
=
Yii
::
$app
->
getRequest
();
$provider
->
realm
=
$request
->
getHostInfo
();
$provider
->
returnUrl
=
$provider
->
realm
.
$request
->
getUrl
();
// getting return URL
$url
=
$provider
->
buildAuthUrl
();
return
Yii
::
$app
->
getResponse
()
->
redirect
(
$url
);
}
...
...
extensions/yii/authclient/OpenId.php
View file @
5a137e6d
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/OpenIdTest.php
0 → 100644
View file @
5a137e6d
<?php
namespace
yiiunit\extensions\authclient
;
use
yii\authclient\OpenId
;
class
OpenIdTest
extends
TestCase
{
protected
function
setUp
()
{
$config
=
[
'components'
=>
[
'request'
=>
[
'hostInfo'
=>
'http://testdomain.com'
,
'scriptUrl'
=>
'/index.php'
,
],
]
];
$this
->
mockApplication
(
$config
,
'\yii\web\Application'
);
}
// Tests :
public
function
testSetGet
()
{
$client
=
new
OpenId
();
$trustRoot
=
'http://trust.root'
;
$client
->
setTrustRoot
(
$trustRoot
);
$this
->
assertEquals
(
$trustRoot
,
$client
->
getTrustRoot
(),
'Unable to setup trust root!'
);
$returnUrl
=
'http://return.url'
;
$client
->
setReturnUrl
(
$returnUrl
);
$this
->
assertEquals
(
$returnUrl
,
$client
->
getReturnUrl
(),
'Unable to setup return URL!'
);
}
/**
* @depends testSetGet
*/
public
function
testGetDefaults
()
{
$client
=
new
OpenId
();
$this
->
assertNotEmpty
(
$client
->
getTrustRoot
(),
'Unable to get default trust root!'
);
$this
->
assertNotEmpty
(
$client
->
getReturnUrl
(),
'Unable to get default return URL!'
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment