-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add keycloak documentation #430
Open
burak-58
wants to merge
3
commits into
master
Choose a base branch
from
keycloakDocs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: Keycloak Integration | ||
description: This guide explains how you can integrate your streaming application with [Keycloak](https://www.keycloak.org/) Identity Management to make WebRTC pages secure. | ||
keywords: [Keycloak, Stream security, Ant Media Server Documentation, Ant Media Server Tutorials] | ||
sidebar_position: 7 | ||
--- | ||
|
||
[Keycloak](https://www.keycloak.org/) is an Identity Management tool which makes authentication and authorization easy for different services by providing a single sign-on (SSO) solution. We can use Keycloak to make WebRTC pages secure by Keycloak authentication. | ||
|
||
Ant Media default streaming application `StreamApp.war` has Keycloak integration as disabled. So if you create your own streaming application using from `StreamApp.war` or configure an existing application coming from installation, you should enable and configure Keycloak configurations. Here we will tell Keycloak and Ant Media Side configurations. | ||
|
||
# Keycloak Confiuration | ||
|
||
1. Please check [Keycloak Getting Started](https://www.keycloak.org/guides#getting-started) documentation to Setup Keycloak. | ||
2. After make it run we will create a **Realm** from Keycloak Dashboard. Lets name it **antmedia** | ||
3. Create an **Open ID Client** in the Realm (**antmedia**) we created in step2. Lets name it **stream-application**. Then set the URL as in the image below. | ||
![](@site/static/img/stream-security/keycloak-client-creation.png) | ||
|
||
4. Create a role in the Client (**stream-application**) we created in step3. Lets make role name **user** | ||
5. Create a User in Realm with the role (**user**) we created in step4. Lets make user name **streamer1** | ||
|
||
|
||
With the above configurations Keycloak side is ready. Now we will proceed with AMS configuration. | ||
|
||
# AMS Configuration | ||
1. Please navigate to the application folder in your AMS installation like: | ||
`cd /usr/local/antmedia/webapps/{APP-NAME}/WEB-INF` | ||
2. Uncomment the following lines in red5-web.xml and set the values according to you Keycloak server configurations. | ||
```xml | ||
<!-- For Keycloak Integration --> | ||
<!-- | ||
<bean id="openid.config" class="io.antmedia.SecurityConfiguration"> | ||
<property name="realmUrl" value="http://keycloak.antmedia.cloud:8080/realms/antmedia" /> | ||
<property name="appName" value="demo" /> | ||
<property name="clientId" value="stream-application" /> | ||
<property name="role" value="user" /> | ||
</bean> | ||
--> | ||
``` | ||
**Note that:** appName should be the same with the application name we are configuring. Also all these parameters shoul be compatible with the configuration in the Keycloak. | ||
|
||
3. Uncomment the following lines in web.xml | ||
```xml | ||
<!-- For Keycloak Integration --> | ||
<!-- | ||
<filter> | ||
<filter-name>ContentSecurityPolicyHeaderFilter</filter-name> | ||
<filter-class>io.antmedia.filter.ContentSecurityPolicyHeaderFilter</filter-class> | ||
<async-supported>true</async-supported> | ||
</filter> | ||
<filter-mapping> | ||
<filter-name>ContentSecurityPolicyHeaderFilter</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
--> | ||
``` | ||
4. Restart the antmedia service | ||
|
||
`sudo service antmedia restart` | ||
|
||
# AMS Configuration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This header is a duplicate + i think we should use the one with ## since it add's a link for navigation at the top right of the screen |
||
|
||
Try to publish a WebRTC stream through sample publish page. It should requires Keycloak authentication. | ||
`https://{AMS-URL}/{APP-NAME}/samples/publish_webrtc.html` | ||
|
||
|
||
Try to play a stream through sample play page: | ||
`https://{AMS-URL}/{APP-NAME}/player.html` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@burak-58 I think we used :::infoTEXT HERE::: for the notes in other documents so lets keep it consistent ! :D