jap

package module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2016 License: BSD-2-Clause Imports: 11 Imported by: 0

README

Jitsi Authentication Portal

GoDoc License

The Jitsi Authentication Portal is an OAuth2 frontend that allows authentication with a number of third party providers and generates short-lived, signed, JWT (jot) tokens to assert the users identity to Jitsi Meet.

The package contains a number of handlers which can be used to build your own compatible login service. There is also an example service in the cmd/jap directory which provides a simple frontend.

To get started, install the jap command and run it:

go get github.com/jitsi/jap
go install github.com/jitsi/jap/cmd/jap
jap -help

License

The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file LICENSE.md.

Documentation

Overview

Package jap (Jitsi Authentication Provider) contains HTTP handlers and utilities for authenticating against a range of OAuth2 providers and returning signed JWT assertions about the authenticated user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDFromContext

func CIDFromContext(ctx context.Context) (cid string, ok bool)

CIDFromContext returns the client ID bound to the context, if any.

func GoogleLogin

func GoogleLogin(ctx context.Context, key *rsa.PrivateKey, permCheck PermissionChecker) func(http.ResponseWriter, *http.Request)

GoogleLogin returns a handler which attempts to extract a client ID from its context and sends the information to Google to validate the user. If no client ID exists in the context it panics.

The handler may return one of the following errors:

400 BadRequest          – If the id_token form param is missing.
401 StatusUnauthorzed   — If the permCheck function returns false.
408 RequestTimeout      – If the contexts deadline was exceeded.
500 InternalServerError – If the upstream returns a response we don't understand.
502 BadGateway          – If an upstream service fails to respond for another reason.

func NewCIDContext

func NewCIDContext(ctx context.Context, cid string) context.Context

NewCIDContext returns a copy of the parent context and associates it with a client id.

Types

type PermissionChecker

type PermissionChecker func(tok string) (bool, error)

PermissionChecker is a function that's used for checking if the email associated with a given token has permission to perform some action.

Directories

Path Synopsis
cmd
jap
The jap command launches an OAuth2 server that generates a JSON Web Signature (JWS) to prove the users identity to other Jitsi services.
The jap command launches an OAuth2 server that generates a JSON Web Signature (JWS) to prove the users identity to other Jitsi services.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL