Skip to content
This repository has been archived by the owner on Nov 13, 2020. It is now read-only.

Financial-Times/ft-s3o-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft-s3o-go

CircleCI

Go middleware to handle authenticating with S3O

  • If the user is not authenticated, the library redirects to S3O for authentication.
  • username and token cookies will be stored after a successful auth.

For documentation, click this link: GoDoc

Example Usage

package main

import (
	"log"
	"net/http"

	"github.com/Financial-Times/ft-s3o-go/s3o"
)

func main() {
	// create a "hello world" hander
	var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("hello secure world\n")) })

	// secure it with s3o
	handler = s3o.Handler(handler)

	// start our server
	log.Fatal(http.ListenAndServe(":8080", handler))
}