auth

Paddy 2014-12-14 Parent:d03786cbf3ae Child:c03b5eb3179e

106:d442523df640 Go to Latest

auth/authd/server.go

Init Config, add profile handlers, and add grant template. Call config.Init() before attempting to use it. Register our profile handlers with the router. Define a simple get_grant template for the authorization grant endpoint.

History
     1.1 --- a/authd/server.go	Sun Dec 14 17:02:23 2014 -0500
     1.2 +++ b/authd/server.go	Sun Dec 14 17:03:33 2014 -0500
     1.3 @@ -21,6 +21,10 @@
     1.4  		Template:      template.Must(template.New("base").ParseGlob("./templates/*.gotmpl")),
     1.5  		LoginURI:      "/login",
     1.6  	}
     1.7 +	err := config.Init()
     1.8 +	if err != nil {
     1.9 +		log.Fatal(err)
    1.10 +	}
    1.11  	context, err := auth.NewContext(config)
    1.12  	if err != nil {
    1.13  		panic(err)
    1.14 @@ -29,6 +33,7 @@
    1.15  	router := mux.NewRouter()
    1.16  	auth.RegisterOAuth2(router, context)
    1.17  	auth.RegisterSessionHandlers(router, context)
    1.18 +	auth.RegisterProfileHandlers(router, context)
    1.19  	http.Handle("/", router)
    1.20  	log.Fatal(http.ListenAndServe(":8080", nil))
    1.21  }