rm jwk stuff
This commit is contained in:
parent
f875ef4071
commit
a3733511b6
2 changed files with 2 additions and 8 deletions
|
@ -34,7 +34,6 @@ void main(List<String> argsRaw) async {
|
||||||
apiHelper.openidConfiguration,
|
apiHelper.openidConfiguration,
|
||||||
)
|
)
|
||||||
..get("/userinfo", apiHelper.userinfoHandler)
|
..get("/userinfo", apiHelper.userinfoHandler)
|
||||||
..get("/jwks.json", apiHelper.jwks)
|
|
||||||
..post("/login", apiHelper.handleLogin)
|
..post("/login", apiHelper.handleLogin)
|
||||||
..post("/token", apiHelper.tokenHandler))
|
..post("/token", apiHelper.tokenHandler))
|
||||||
.call,
|
.call,
|
||||||
|
|
|
@ -81,11 +81,12 @@ class ApiHelper {
|
||||||
);
|
);
|
||||||
|
|
||||||
final token = jwt.sign(SecretKey(secret), algorithm: JWTAlgorithm.HS256);
|
final token = jwt.sign(SecretKey(secret), algorithm: JWTAlgorithm.HS256);
|
||||||
|
print("Token: $token"); //TODO: Remove
|
||||||
|
|
||||||
return Response.ok(
|
return Response.ok(
|
||||||
json.encode({
|
json.encode({
|
||||||
"id_token": token,
|
"id_token": token,
|
||||||
"access_token": token, // TODO: Use real access token
|
"access_token": token,
|
||||||
"token_type": "Bearer",
|
"token_type": "Bearer",
|
||||||
"expires_in": 600,
|
"expires_in": 600,
|
||||||
}),
|
}),
|
||||||
|
@ -118,11 +119,6 @@ class ApiHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Response jwks(_) => Response.ok(
|
|
||||||
json.encode({"keys": []}),
|
|
||||||
headers: {"content-type": "application/json"},
|
|
||||||
);
|
|
||||||
|
|
||||||
Response openidConfiguration(_) {
|
Response openidConfiguration(_) {
|
||||||
final settings = ref.read(SettingsController.provider)!;
|
final settings = ref.read(SettingsController.provider)!;
|
||||||
return Response.ok(
|
return Response.ok(
|
||||||
|
@ -131,7 +127,6 @@ class ApiHelper {
|
||||||
"authorization_endpoint": settings.authorizeEndpoint,
|
"authorization_endpoint": settings.authorizeEndpoint,
|
||||||
"token_endpoint": "${settings.issuer}/token",
|
"token_endpoint": "${settings.issuer}/token",
|
||||||
"userinfo_endpoint": "${settings.issuer}/userinfo",
|
"userinfo_endpoint": "${settings.issuer}/userinfo",
|
||||||
"jwks_uri": "${settings.issuer}/jwks.json",
|
|
||||||
"response_types_supported": ["code"],
|
"response_types_supported": ["code"],
|
||||||
"subject_types_supported": ["public"],
|
"subject_types_supported": ["public"],
|
||||||
"id_token_signing_alg_values_supported": ["HS256"],
|
"id_token_signing_alg_values_supported": ["HS256"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue