2022-03-20 17:51:42 +00:00
|
|
|
import { Controller, Get, Redirect } from '@nestjs/common';
|
2022-12-02 20:33:02 +00:00
|
|
|
import { ConfigurationService } from './modules/config/config.service';
|
2022-03-09 18:37:04 +00:00
|
|
|
|
|
|
|
@Controller()
|
|
|
|
export class AppController {
|
2022-12-02 20:33:02 +00:00
|
|
|
constructor(private config: ConfigurationService) {}
|
|
|
|
|
2022-03-09 18:37:04 +00:00
|
|
|
@Get()
|
2022-03-20 17:51:42 +00:00
|
|
|
@Redirect('/account/general')
|
|
|
|
getHello() {
|
|
|
|
return;
|
2022-03-09 18:37:04 +00:00
|
|
|
}
|
2022-12-02 20:33:02 +00:00
|
|
|
|
|
|
|
@Get('/.well-known/openid-configuration')
|
|
|
|
openidConfiguration() {
|
|
|
|
const base = this.config.get<string>('app.base_url');
|
|
|
|
return {
|
|
|
|
issuer: this.config.get('jwt.issuer'),
|
|
|
|
authorization_endpoint: `${base}/oauth2/authorize`,
|
|
|
|
token_endpoint: `${base}/oauth2/token`,
|
|
|
|
jwks_uri: `${base}/oauth2/jwks`,
|
|
|
|
userinfo_endpoint: `${base}/api/user`,
|
|
|
|
introspection_endpoint: `${base}/oauth2/introspect`,
|
|
|
|
response_types_supported: ['code', 'id_token'],
|
|
|
|
id_token_signing_alg_values_supported: [this.config.get('jwt.algorithm')],
|
|
|
|
subject_types_supported: ['public'],
|
2022-12-03 08:02:58 +00:00
|
|
|
scopes_supported: ['openid', 'profile', 'picture', 'email'],
|
2022-12-02 20:33:02 +00:00
|
|
|
claims_supported: [
|
|
|
|
'aud',
|
|
|
|
'exp',
|
|
|
|
'iat',
|
|
|
|
'iss',
|
|
|
|
'sub',
|
|
|
|
'name',
|
|
|
|
'preferred_username',
|
2022-12-03 08:02:58 +00:00
|
|
|
'nickname',
|
2022-12-02 20:33:02 +00:00
|
|
|
'profile',
|
|
|
|
'picture',
|
|
|
|
'updated_at',
|
|
|
|
'email',
|
|
|
|
'email_verified',
|
|
|
|
],
|
|
|
|
code_challenge_methods_supported: ['plain', 'S256'],
|
|
|
|
grant_types_supported: ['authorization_code', 'refresh_token'],
|
|
|
|
};
|
|
|
|
}
|
2022-03-09 18:37:04 +00:00
|
|
|
}
|