Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tustin committed Sep 19, 2018
1 parent 2163ca5 commit a9325b1
Showing 1 changed file with 2 additions and 40 deletions.
42 changes: 2 additions & 40 deletions README.md
Expand Up @@ -11,47 +11,9 @@ A PHP wrapper for the PlayStation API.
Pull in the project with composer:
`composer require tustin/psn-php`

### Authenticating
## Documentation

You cannot login using the traditional method with this library due to Sony incorperating ReCaptcha2 on all PlayStation login forms. As a result, you can only login using two methods.

#### With Two Factor Authentication

1. Enable Two Factor Authentication on your account using the PlayStation website or app.
2. Navigate to https://www.bungie.net/en/User/SignIn/Psnid?code=000000 in your browser and login using the PlayStation website.
3. When it asks for your 2FA code, **DO NOT** enter it. Instead, look in the URL. You should see a parameter called `ticket_uuid`.
4. Get the value of `ticket_uuid` from the URL (it will look similar to this: `b7aeb485-xxxx-4ec2-zzzz-0f23bcee5bc5`) and the 2FA code from your device. You can now login using the library like so:

```php
require_once 'vendor/autoload.php';

use PlayStation\Client;

$client = new Client();
// v ticket_uuid v 2FA code
$client->login('b7aeb485-xxxx-4ec2-zzzz-0f23bcee5bc5', '000000');

$refreshToken = $client->refreshToken();
```

5. You can now call `$client->refreshToken();` to get the refresh token for your account and automate all future logins by following the next authentication method.

#### With A Refresh Token

1. Using a refresh token is the easiest and fastest way to login. These tokens can expire but as long as you login frequently and save the new refresh token, you should be fine.

```php
require_once 'vendor/autoload.php';

use PlayStation\Client;

$client = new Client();
$client->login('b17b5ce5-xxxx-yyyy-zzzz-5996a213b834');

$refreshToken = $client->refreshToken();
```

2. Again, make sure you save the new refresh token once you login with an existing one. Your old token will still work, but saving the newest tokens is the best way to prevent login issues in the future when the token eventually expires.
Please visit [the psn-php documentation](https://tusticles.com/psn-php/) page to see how to use this library.

## Disclaimer

Expand Down

0 comments on commit a9325b1

Please sign in to comment.