From e777c6bdc6f12f9152335f8bfd66b956aedc9957 Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Fri, 8 Mar 2019 17:42:50 +0100 Subject: Integrate OAuth2 Provider (#5378) --- routers/routes/routes.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'routers/routes') diff --git a/routers/routes/routes.go b/routers/routes/routes.go index b73b030a51..01da321e49 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -257,6 +257,14 @@ func RegisterRoutes(m *macaron.Macaron) { }) }, reqSignOut) + m.Group("/login/oauth", func() { + m.Get("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth) + m.Post("/grant", bindIgnErr(auth.GrantApplicationForm{}), user.GrantApplicationOAuth) + // TODO manage redirection + m.Post("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth) + }, ignSignInAndCsrf, reqSignIn) + m.Post("/login/oauth/access_token", bindIgnErr(auth.AccessTokenForm{}), ignSignInAndCsrf, user.AccessTokenOAuth) + m.Group("/user/settings", func() { m.Get("", userSetting.Profile) m.Post("", bindIgnErr(auth.UpdateProfileForm{}), userSetting.ProfilePost) @@ -291,6 +299,12 @@ func RegisterRoutes(m *macaron.Macaron) { }, openIDSignInEnabled) m.Post("/account_link", userSetting.DeleteAccountLink) }) + m.Group("/applications/oauth2", func() { + m.Get("/:id", userSetting.OAuth2ApplicationShow) + m.Post("/:id", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsEdit) + m.Post("", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsPost) + m.Post("/delete", userSetting.DeleteOAuth2Application) + }) m.Combo("/applications").Get(userSetting.Applications). Post(bindIgnErr(auth.NewAccessTokenForm{}), userSetting.ApplicationsPost) m.Post("/applications/delete", userSetting.DeleteApplication) -- cgit v1.2.3