Add configuration example
[fbfp.git] / main.go
blob024f329829ba203088a468f06d757ec5dbd9f8c3
1 package main
3 import (
4 "log"
5 "net/http"
8 func handle_index(w http.ResponseWriter, req *http.Request) {
9 openid_authorization_url := generate_authorization_url()
11 http.Redirect(w, req, openid_authorization_url, 303)
14 func main() {
15 fbfp_get_config("fbfp.scfg")
17 log.Printf("Fetching OpenID Connect configuration\n")
18 get_openid_config(config.Openid.Endpoint)
20 log.Printf("Registering handlers\n")
21 http.HandleFunc("/", handle_index)
22 http.HandleFunc(config.Openid.Redirect, handle_oidc)
24 log.Printf("Listening on %s\n", config.Listen)
25 http.ListenAndServe(config.Listen, nil)