|
|
|
@ -1,12 +1,16 @@
|
|
|
|
|
import { Controller, Get, Redirect, Res } from '@nestjs/common';
|
|
|
|
|
import { Response } from 'express';
|
|
|
|
|
import { ConfigurationService } from '../config/config.service';
|
|
|
|
|
import { JWTService } from '../jwt/jwt.service';
|
|
|
|
|
|
|
|
|
|
@Controller({
|
|
|
|
|
path: '/.well-known/',
|
|
|
|
|
})
|
|
|
|
|
export class WellKnownController {
|
|
|
|
|
constructor(private config: ConfigurationService) {}
|
|
|
|
|
constructor(
|
|
|
|
|
private readonly config: ConfigurationService,
|
|
|
|
|
private readonly jwt: JWTService,
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
@Get('security.txt')
|
|
|
|
|
securityTXT(@Res({ passthrough: true }) res: Response) {
|
|
|
|
@ -28,6 +32,13 @@ Contact: mailto:evert@lunasqu.ee
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get('jwks.json')
|
|
|
|
|
getJWKS() {
|
|
|
|
|
return {
|
|
|
|
|
keys: [this.jwt.jwks],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get('openid-configuration')
|
|
|
|
|
openidConfiguration() {
|
|
|
|
|
const base = this.config.get<string>('app.base_url');
|
|
|
|
@ -35,7 +46,7 @@ Contact: mailto:evert@lunasqu.ee
|
|
|
|
|
issuer: this.config.get('jwt.issuer'),
|
|
|
|
|
authorization_endpoint: `${base}/oauth2/authorize`,
|
|
|
|
|
token_endpoint: `${base}/oauth2/token`,
|
|
|
|
|
jwks_uri: `${base}/oauth2/jwks`,
|
|
|
|
|
jwks_uri: `${base}/.well-known/jwks.json`,
|
|
|
|
|
userinfo_endpoint: `${base}/api/user`,
|
|
|
|
|
introspection_endpoint: `${base}/oauth2/introspect`,
|
|
|
|
|
response_types_supported: ['code', 'id_token'],
|
|
|
|
|