Add openid configuration & well known

This commit is contained in:
LittleSheep 2024-08-12 20:24:17 +08:00
parent 65cd4139f0
commit 52ebaa67a4
4 changed files with 42 additions and 2 deletions

1
.env
View File

@ -1,4 +1,5 @@
NUXT_PUBLIC_SOLAR_REALM_ID=2 NUXT_PUBLIC_SOLAR_REALM_ID=2
NUXT_PUBLIC_SITE_URL=https://solsynth.dev NUXT_PUBLIC_SITE_URL=https://solsynth.dev
NUXT_PUBLIC_SOLARPASS_URL=https://id.solsynth.dev
NUXT_PUBLIC_SOLAR_NETWORK_API=https://api.sn.solsynth.dev NUXT_PUBLIC_SOLAR_NETWORK_API=https://api.sn.solsynth.dev
NUXT_PUBLIC_SOLIAN_URL=https://sn.solsynth.dev NUXT_PUBLIC_SOLIAN_URL=https://sn.solsynth.dev

View File

@ -19,15 +19,23 @@ export default defineNuxtConfig({
public: { public: {
siteUrl: "https://solsynth.dev", siteUrl: "https://solsynth.dev",
solarRealmId: 2, solarRealmId: 2,
solarpassUrl: "https://id.solsynth.dev",
solarNetworkApi: "https://api.sn.solsynth.dev", solarNetworkApi: "https://api.sn.solsynth.dev",
solianUrl: "https://sn.solsynth.dev", solianUrl: "https://sn.solsynth.dev",
}, },
}, },
routeRules: {
"/.well-known/openid-configuration": {
proxy: "/api/well-known/openid-configuration",
},
},
app: { app: {
head: { head: {
title: "Solsynth LLC", title: "Solsynth LLC",
titleTemplate: "%s | Solsynth", titleTemplate: "%s | Solsynth",
meta: [],
link: [ link: [
{ rel: "icon", type: "image/png", href: "/favicon.png" }, { rel: "icon", type: "image/png", href: "/favicon.png" },
{ rel: "preconnect", href: "https://fonts.googleapis.com" }, { rel: "preconnect", href: "https://fonts.googleapis.com" },
@ -50,7 +58,7 @@ export default defineNuxtConfig({
}, },
pinia: { pinia: {
storesDirs: ['./stores/**'], storesDirs: ["./stores/**"],
}, },
build: { build: {

View File

@ -1,5 +1,5 @@
<template> <template>
<v-container class="flex flex-col gap-[4rem] my-[2rem]"> <v-container class="flex flex-col my-2 gap-[4rem]">
<v-row class="content-section"> <v-row class="content-section">
<v-col cols="12" md="4" class="flex justify-start"> <v-col cols="12" md="4" class="flex justify-start">
<div> <div>

View File

@ -0,0 +1,31 @@
export default defineEventHandler((event) => {
const config = useRuntimeConfig()
return {
"authorization_endpoint": `${config.public.siteUrl}/auth/authorize`,
"grant_types_supported": [
"authorization_code",
"implicit",
"refresh_token",
],
"id_token_signing_alg_values_supported": [
"HS512",
],
"issuer": config.public.solarpassUrl,
"response_types_supported": [
"code",
"token",
],
"subject_types_supported": [
"public",
],
"token_endpoint": `${config.public.solarNetworkApi}/cgi/auth/auth/token`,
"token_endpoint_auth_methods_supported": [
"client_secret_post",
],
"token_endpoint_auth_signing_alg_values_supported": [
"HS512",
],
"userinfo_endpoint": `${config.public.solarNetworkApi}/cgi/auth/users/me`,
}
})