Skip to content
Snippets Groups Projects
Commit b2ef1a09 authored by kaiyou's avatar kaiyou
Browse files

Add a peertube application template

parent 172d1bee
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,10 @@ class SynapseApplication(base.SAMLApplication):
obj=service,
application_uri=service.config.get("application_uri")
)
@register("writefreely")
class GitlabApplication(base.OIDCApplication):
class WriteFreelyApplication(base.OIDCApplication):
""" WriteFreely is free, open source, ActivityPub compliant blog software.
"""
......@@ -87,3 +89,33 @@ class GitlabApplication(base.OIDCApplication):
obj=service,
application_uri=service.config.get("application_uri")
)
@register("peertube")
class PeertubeApplication(base.OIDCApplication):
""" PeerTube is free, open source, video publishing software
"""
name = _("PeerTube")
class Form(base.BaseForm):
application_uri = fields.StringField(_("PeerTube URL"), [validators.URL(require_tld=False)])
submit = fields.SubmitField(_('Submit'))
def populate_service(self, form, service):
service.profile_regex = "[a-z0-9_.\-]*"
callback_uri = form.application_uri.data + "/plugins/auth-openid-connect/router/code-cb"
service.config.update({
"application_uri": form.application_uri.data,
"token_endpoint_auth_method": "client_secret_basic",
"redirect_uris": [callback_uri],
"grant_types": ["authorization_code"],
"response_types": ["code"],
})
self.fill_service(service)
def populate_form(self, service, form):
form.process(
obj=service,
application_uri=service.config.get("application_uri")
)
\ No newline at end of file
<h3>Setting up PeerTube</h3>
<p>PeerTube supports OIDC authentication using the official <i>auth-openid-connect</i> plugin: https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-openid-connect.</p>
<p>Once the plugin is install, to configure OIDC authentication, you should fill the following settings.</p>
<dt>Discover URL</dt>
<dd><pre>{{ url_for("sso.oidc_discovery", service_uuid=service.uuid, _external=True) }}</pre></dd>
<dt>Client ID</dt>
<dd><pre>service.config["client_id"]</pre></dd>
<dt>Client secret</dt>
<dd><pre>service.config["client_secret"]</pre></dd>
<dt>Scope</dt>
<dd><pre>openid email profile</pre></dd>
<dt>Username property</dt>
<dd><pre>preferred_username</pre></dd>
<dt>Email property</dt>
<dd><pre>email</pre></dd>
{% include "application_oidc.html" %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment