Skip to content

Commit

Permalink
Merge pull request #1613 from damienbod/docs/logout-params
Browse files Browse the repository at this point in the history
Improve logout docs
  • Loading branch information
FabianGosebrink committed Nov 27, 2022
2 parents 22714da + cabcfef commit d94bf57
Showing 1 changed file with 31 additions and 13 deletions.
Expand Up @@ -180,31 +180,34 @@ You can pass an `logoutAuthOptions` parameter if you want to control the behavio

```ts
logout() {
const logoutAuthOptions = {
const logoutAuthOptions: LogoutAuthOptions = {
customParams: {
logout_hint: 'some-logout-hint',
/* other params */
},
urlHandler: () => {
/* ... */
},
}
};

// Use an empty string for the configId if this is not a multiple client
// subscribe to the result if you expect the function to return.
// => .subscribe((result) => console.log(result));
this.oidcSecurityService.logoff('configId', logoutAuthOptions);
}
```

If you prefer to send a POST logout request:

```
```ts
logout() {
// logoffMethod` - Which can be `GET` or `POST
const logoutAuthOptions: LogoutAuthOptions = {
logoffMethod: 'POST',
};
this.oidcSecurityService.logoff('', logoutAuthOptions)
.subscribe((result) => console.log(result));
// logoffMethod` - Which can be `GET` or `POST
const logoutAuthOptions: LogoutAuthOptions = {
customParams: {
logout_hint: 'some-logout-hint',
},
logoffMethod: 'POST',
};

this.oidcSecurityService.logoff('', logoutAuthOptions)
.subscribe((result) => console.log(result));
}
```

Expand All @@ -219,6 +222,21 @@ logoffAndRevokeTokens() {
}
```

or an example using the LogoutAuthOptions parameters:

```ts
logoffAndRevokeTokens() {
const logoutAuthOptions: LogoutAuthOptions = {
customParams: {
logout_hint: 'some-logout-hint',
},
};

this.oidcSecurityService.logoffAndRevokeTokens('', logoutAuthOptions)
.subscribe((result) => console.log(result));
}
```

The method also takes `configId` and `logoutAuthOptions` parameters if needed.

### `logoffLocal()`
Expand Down

0 comments on commit d94bf57

Please sign in to comment.