10 func handle_index(w http
.ResponseWriter
, req
*http
.Request
) {
11 openid_authorization_url
:= generate_authorization_url()
13 http
.Redirect(w
, req
, openid_authorization_url
, 303)
17 fbfp_get_config("fbfp.scfg")
19 log
.Printf("Fetching OpenID Connect configuration\n")
20 get_openid_config(config
.Openid
.Endpoint
)
22 log
.Printf("Registering handlers\n")
23 http
.HandleFunc("/", handle_index
)
24 http
.HandleFunc(config
.Openid
.Redirect
, handle_oidc
)
27 "Establishing listener for net %s, addr %s\n",
32 l
, err
:= net
.Listen(config
.Net
, config
.Addr
)
35 if config
.Proto
== "http" {
36 log
.Printf("Serving http\n")
37 err
= http
.Serve(l
, nil)
38 } else if config
.Proto
== "fcgi" {
39 log
.Printf("Serving fcgi\n")
40 err
= fcgi
.Serve(l
, nil)