Auth: Add authentication config frontend routes to api.go (#66931)

* Add auth config frontend routes to api.go

* Remove SAML related endpoints

* Fix routes

* Enable authconfig for Enterprise, Cloud Pro and Advanced

* Fix

* Update public/app/routes/routes.tsx

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
This commit is contained in:
Misi 2023-04-25 13:13:55 +02:00 committed by GitHub
parent 9d7c3a101d
commit b3aaf544a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -224,6 +224,10 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/user/auth-tokens/rotate", routing.Wrap(hs.RotateUserAuthTokenRedirect))
}
if hs.License.FeatureEnabled("saml") && hs.Features.IsEnabled(featuremgmt.FlagAuthenticationConfigUI) {
r.Get("/admin/authentication/", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsAll)), hs.Index)
}
// authed api
r.Group("/api", func(apiRoute routing.RouteRegister) {
// user (signed in)

View File

@ -309,11 +309,12 @@ export function getAppRoutes(): RouteDescriptor[] {
// ADMIN
{
path: '/admin/authentication',
component: config.featureToggles.authenticationConfigUI
? SafeDynamicImport(
() => import(/* webpackChunkName: "AdminAuthentication" */ 'app/features/auth-config/AuthConfigPage')
)
: () => <Redirect to="/admin" />,
component:
config.featureToggles.authenticationConfigUI && config.licenseInfo.enabledFeatures?.saml
? SafeDynamicImport(
() => import(/* webpackChunkName: "AdminAuthentication" */ 'app/features/auth-config/AuthConfigPage')
)
: () => <Redirect to="/admin" />,
},
{
path: '/admin',