extend SSO docs (#4154)

This commit is contained in:
Denys Vuika 2019-01-14 17:46:00 +00:00 committed by Eugenio Romano
parent 581f53da59
commit 9645a3785c

View File

@ -269,7 +269,7 @@ export class MyCustomLogin {
Note that if you do not call `event.preventDefault()` then the default behaviour Note that if you do not call `event.preventDefault()` then the default behaviour
will execute _after_ your custom code has completed. will execute _after_ your custom code has completed.
### SSO login ### Single Sign-On (SSO)
#### Implicit Flow #### Implicit Flow
@ -277,9 +277,11 @@ If you used the host-setting component to enable SSO Oauth (or if you
enabled the setting in `app.config.json`) then the [login component](../core/login.component.md) will show only a button to login: enabled the setting in `app.config.json`) then the [login component](../core/login.component.md) will show only a button to login:
```JSON ```JSON
{
"providers": "ECM",
"authType" :"OAUTH", "authType" :"OAUTH",
"oauth2": { "oauth2": {
"host": "http://localhost:30081/auth/realms/myrealm", "host": "<AUTH-SERVER>/auth/realms/alfresco",
"clientId": "activiti", "clientId": "activiti",
"scope": "openid", "scope": "openid",
"secret": "", "secret": "",
@ -287,7 +289,8 @@ enabled the setting in `app.config.json`) then the [login component](../core/log
"silentLogin": false, "silentLogin": false,
"redirectUri": "/", "redirectUri": "/",
"redirectUriLogout": "/logout" "redirectUriLogout": "/logout"
}, }
}
``` ```
![Login component](../docassets/images/sso-login.png) ![Login component](../docassets/images/sso-login.png)
@ -296,6 +299,44 @@ Note that if the `silentLogin` property in the `oauth2` configuration is set to
then the login page will not be shown. Instead, the application will redirect then the login page will not be shown. Instead, the application will redirect
automatically to the authorization server when the user is not logged-in automatically to the authorization server when the user is not logged-in
#### Silent login
You can also enable automatic redirection to OAuth provider
by utilising the following properties:
* silentLogin
* redirectSilentIframeUri
```json
{
"providers": "ECM",
"authType": "OAUTH",
"oauth2": {
"host": "<AUTH-SERVER>/auth/realms/alfresco",
"clientId": "alfresco",
"scope": "openid",
"secret": "",
"implicitFlow": true,
"silentLogin": true,
"redirectSilentIframeUri": "/assets/silent-refresh.html",
"redirectUri": "/",
"redirectUriLogout": "/logout"
},
```
Please note that if you deploy the application to a virtual folder,
for example `http://<ADDRESS>/my-app`, then `redirectSilentIframeUri`
must contain the full URI value:
```json
{
"redirectSilentIframeUri": "http://<ADDRESS>/my-app/assets/silent-refresh.html",
}
```
> In the default ADF application configurations the `silent-refresh.html` file
> gets automatically copied to the application output when building for production.
## See Also ## See Also
- [Logout directive](logout.directive.md) - [Logout directive](logout.directive.md)