getLogoutUrl() has an optional parameter redirectUrl. If set, after the logout you will be redirected to that. Else to the 'redirectUri' of the sdk config.

In both cases getLogoutUrl() will append the get parameter logout=true to redirectUrl (which is used by e.g. parseRedirectUrl() to clean the persistent storage).

Examples

Can be found in the folder: ./examples/*

Running

Open a terminal, in the sdk root folder run php composer.phar install.

If you use php >= 5.4 you can now try ./run.sh (as root/sudo) in the ./examples folder. Keep an eye on the console messages (it will complain about the /etc/hosts config, add it). If everything works, you should be able to open the (local) url shown in the console afterwards.

On Windows, or if run.sh is not working: With php >= 5.4 just try php -S mytestserver.local:8080 in the ./examples folder (as root/sudo on linux/osx). Notice you have to add 127.0.0.1 mytestserver.local to your /etc/hosts for this to work. (Windows: system32\drivers\etc\hosts)

For php < 5.4 refer to your server documentation to create a vhost config with the document root pointing to the ./examples folder.

Files

./examples/basic.php:

example for typical usecase, just as much code as needed. Note, that you need to set your redirectUrl to {yourdomain}/basic.php

./examples/parent_page.php & ./examples/result_page.php:

example for showing more options, intercepts the redirect, so you can take a look at the params returned. Note, that you need to set your redirectUrl to {yourdomain}/result_page.php

Config

[^1]:* If the user is not logged in there, it will grant the user for its username and password and then redirect back to your site with an access token.
* If your user however already is logged in, it will just redirect back to your site with an access token.
* There is one more authorization flow step after those possible grants from the user and really fetching the access token, but the auth-sdk will gently hide that from you