Skip to content

Commit

Permalink
Docs: Login as
Browse files Browse the repository at this point in the history
  • Loading branch information
rap1ds committed May 20, 2024
1 parent ceb26ec commit 985459b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ the session information may not be saved after successful login. In
this case, you should configure the SDK to use [memory-based token
store](./token-store.md#memory-store).

## Login As

**`sdk.loginAs({ code: string, redirect_uri: string, code_verifier: string }) : Promise`**

Logs in the marketplace operator as the marketplace user and returns a Promise.

The session information will be saved to the SDK instance when the
Promise is resolved. Subsequent requests will be made as the logged in
user.

## Login with IdP

**`sdk.loginWithIdp({ idpId: string, idpClientId: string, idpToken: string }) : Promise`**
Expand All @@ -45,10 +55,11 @@ user.

**`sdk.authInfo() : Promise(Object)`**

Returns a Promise with an Object as a value. The object may contain two fields:
Returns a Promise with an Object as a value. The object may contain the following fields:

- `scopes`: an array containing the scopes associated with the currently stored token
- `isAnonymous`: a boolean denoting if the currently stored token only allows public read access
- `isLoggedInAs`: a boolean denoting if the marketplace operator is logged in as a marketplace user

To determine if the user is logged in, check if `isAnonymous` equals
`false`.
Expand Down

0 comments on commit 985459b

Please sign in to comment.