2024-06-22 05:04:21 +00:00
|
|
|
package api
|
2024-01-28 16:32:39 +00:00
|
|
|
|
|
|
|
import (
|
2024-01-30 08:04:12 +00:00
|
|
|
"fmt"
|
2024-03-16 06:47:16 +00:00
|
|
|
|
2024-01-28 16:32:39 +00:00
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
2024-01-30 08:04:12 +00:00
|
|
|
func getOidcConfiguration(c *fiber.Ctx) error {
|
|
|
|
domain := viper.GetString("domain")
|
|
|
|
basepath := fmt.Sprintf("https://%s", domain)
|
|
|
|
|
|
|
|
return c.JSON(fiber.Map{
|
2024-08-12 12:58:20 +00:00
|
|
|
"issuer": viper.GetString("security.issuer"),
|
2024-04-21 09:27:05 +00:00
|
|
|
"authorization_endpoint": fmt.Sprintf("%s/authorize", basepath),
|
2024-02-19 08:25:57 +00:00
|
|
|
"token_endpoint": fmt.Sprintf("%s/api/auth/token", basepath),
|
2024-01-30 08:04:12 +00:00
|
|
|
"userinfo_endpoint": fmt.Sprintf("%s/api/users/me", basepath),
|
|
|
|
"response_types_supported": []string{"code", "token"},
|
|
|
|
"grant_types_supported": []string{"authorization_code", "implicit", "refresh_token"},
|
|
|
|
"subject_types_supported": []string{"public"},
|
|
|
|
"token_endpoint_auth_methods_supported": []string{"client_secret_post"},
|
|
|
|
"id_token_signing_alg_values_supported": []string{"HS512"},
|
|
|
|
"token_endpoint_auth_signing_alg_values_supported": []string{"HS512"},
|
|
|
|
})
|
|
|
|
}
|