You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package will need to be configured with your [api key](https://dashboard.workos.com/api-keys) and [project id](https://dashboard.workos.com/sso/configuration).
31
32
By default, the package will look for a `WORKOS_API_KEY` and `WORKOS_PROJECT_ID` environment variable.
32
33
33
-
### SSO
34
-
The package offers the following convenience functions to utilize WorkOS SSO.
35
-
36
-
First we'll want to generate an OAuth 2.0 Authorization URL to initiate the SSO workflow with:
34
+
## Usage
37
35
38
-
```php
39
-
$url = (new \WorkOS\SSO())->getAuthorizationUrl(
40
-
'foo-corp.com',
41
-
'http://my.cool.co/auth/callback',
42
-
['things' => 'gonna get this back'],
43
-
null // Pass along provider if we don't have a domain
44
-
);
45
-
```
46
-
47
-
After directing the user to the Authorization URL and successfully completing the SSO workflow, use
48
-
the code passed back from WorkOS to grab the profile of the authenticated user to verify all is good:
49
-
50
-
```php
51
-
$profile = (new \WorkOS\SSO())->getProfile($code);
52
-
```
36
+
Underneath it all, the Laravel SDK utilizes the WorkOS PHP SDK. For more information on usage, check out the docs [here](https://docs.workos.com/sdk/laravel) and the PHP SDK [here](https://github.com/workos-inc/workos-php).
0 commit comments