authserver

package
v0.0.0-...-7a84625 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHeadersHandler

func AuthHeadersHandler(h http.Handler) http.HandlerFunc

AuthHeadersHandler If client is web create Authorization header out of cookies

func RequestRoutedCallback

func RequestRoutedCallback(ctx context.Context) (context.Context, error)

RequestRoutedCallback validate JWT from header

func ResponsePreparedCallback

func ResponsePreparedCallback(ctx context.Context) context.Context

ResponsePreparedCallback is called after our implementation is called, but prior to writing to response

Types

type CustomClaims

type CustomClaims struct {
	UserID string `json:"userId"`
	Email  string `json:"email"`
	Name   string `json:"name"`
}

CustomClaims are claims for the JWT @see https://trello.com/c/wrefQdsh/23-define-whats-in-jwt

type PlatformClaims

type PlatformClaims struct {
	jwt.StandardClaims
	CustomClaims
}

PlatformClaims JWT claims for the platform

type Server

type Server struct{ Firebase *firebase.App }

Server implements the service

func (*Server) Token

func (s *Server) Token(ctx context.Context, msg *rpc.TokenReq) (*rpc.TokenRes, error)

Token is called whenever the client needs a token. If first "login" the client will pass us a firebase token otherwise we have a token we've already created so we need to validate, and create a new one

Jump to

Keyboard shortcuts

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