Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit 0866631

Browse files
committed
Merge pull request #125 from stormpath/feature/ID_Site_Password
Added SP_TOKEN to idsite for forgot password
2 parents bd355cd + 5906a98 commit 0866631

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,21 @@ $forgotLink = $application->createIdSiteUrl(['path'=>'/#/forgot','callbackUri'=>
639639
header('Location:'.$forgotLink); //or any other form of redirect to the $loginLink you want to use.
640640
```
641641

642+
##### Using SP_Token for password reset from workflow in ID Site
643+
644+
We allow you to use the Workflow for password reset outside of the ID Site system, but enable you to use the password
645+
reset screens of the ID Site to do the password reset. To allow for this, you need to pass in the `sp_token` parameter
646+
that was provided in the email of the password reset.
647+
```php
648+
$application = \Stormpath\Resource\Application::get('{APPLICATION_ID}');
649+
$location = $application->createIdSiteUrl([
650+
'path'=>'/#/reset',
651+
'sp_token'=>'{{SP_TOKEN}}',
652+
'callbackUri'=>'{{CALLBACK_URI}}'
653+
]);
654+
header('Location:'.$forgotLink); //or any other form of redirect to the $loginLink you want to use.
655+
```
656+
642657
Again, with all these methods, You will want your application to link to an internal page where the JWT is created at
643658
that time. Without doing this, a user will only have 60 seconds to click on the link before the JWT expires.
644659

src/Resource/Application.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ public function createIdSiteUrl(array $options = array())
346346
'cb_uri' => $options['callbackUri']
347347
);
348348

349+
if(isset($options['sp_token'])) {
350+
$token['sp_token'] = $options['sp_token'];
351+
}
352+
349353
if(isset($options['organizationNameKey'])) {
350354
$token['onk'] = $options['organizationNameKey'];
351355
}

0 commit comments

Comments
 (0)