Skip to content

Commit 315f982

Browse files
committed
fix(header): Fixed documentation according to changes
1 parent b0787e8 commit 315f982

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

doc/components/01-header.md

+5-17
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ To use Header simply embed the ws-header in your application and import the scss
1111
```html
1212
<ws-header
1313
appName="Demo Page"
14+
businessPartnerId="business-partner-id"
1415
clientId="youturn-client-id"
1516
links="{[
1617
{label: 'Link', href: 'LinkValue', onClick: (value) => console.log(value)},
@@ -59,11 +60,9 @@ you have to listen for the `ws-locale-changed` event on the window object.
5960
## Authorization
6061
Every user must retrieve an access token via the OAuth2 Implicit flow to get access to the backend resources.
6162
The header already implements these implicit flow and a login button. To be able to authenticate with the
62-
implicit flow you have to specify you're client id. The other required fields are filled with the following defaults.
63-
- **loginUrl**: https://identity.zalando.com/oauth2/authorize
64-
- **businessPartnerId**: zalando's business partner id
63+
implicit flow you have to specify you're client and business partner id. The default login url is: https://identity.zalando.com/oauth2/authorize
6564
```html
66-
<ws-header app-name="Test app" client-id="yourturn-client-id"></ws-header>
65+
<ws-header app-name="Test app" client-id="yourturn-client-id" business-partner-id="bpid"></ws-header>
6766
```
6867

6968
##### Getting the access token
@@ -79,12 +78,10 @@ if the access_token was successfully parsed from the location.hash. It can be em
7978
```
8079

8180
To get the access token for example to validate if the user can access the current route you can call
82-
the static function `getAccessToken()` which will return a promise with the access token or null.
81+
the static function `getAccessToken()` which will return the access token or null.
8382
```html
8483
<script>
85-
WSHeader.getAccessToken().then(accessToken => {
86-
console.log('Current access token is: ', accessToken);
87-
})
84+
console.log('Current access token is: ', WSHeader.getAccessToken());
8885
</script>
8986
```
9087

@@ -103,12 +100,3 @@ listening for those events and triggers the corresponding action. Afterwards a `
103100
window.dispatchEvent(new CustomEvent('ws-unauthorize'));
104101
</script>
105102
```
106-
107-
##### Refresh tokens (experimental)
108-
Since the refresh token URL of Zalando don't permit cross origin access you have to provide a
109-
proxy solution by yourself and specify the url as attribute. The proxy url should point to
110-
`https://identity.zalando.com/oauth2/token`. The header automatically will request a new access token
111-
once the expiration time of the last one was reached and a `ws-auth-changed` event will be published.
112-
```html
113-
<ws-header app-name="Test app" client-id="yourturn-client-id" refresh-url="/backend/identity/refresh"></ws-header>
114-
```

0 commit comments

Comments
 (0)