mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 04:33:15 +02:00
28 lines
750 B
TypeScript
28 lines
750 B
TypeScript
|
|
import { GenericOidcProvider } from "./genericOidc.provider";
|
||
|
|
import { Inject, Injectable } from "@nestjs/common";
|
||
|
|
import { ConfigService } from "../../config/config.service";
|
||
|
|
import { JwtService } from "@nestjs/jwt";
|
||
|
|
import { CACHE_MANAGER } from "@nestjs/cache-manager";
|
||
|
|
import { Cache } from "cache-manager";
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class OidcProvider extends GenericOidcProvider {
|
||
|
|
constructor(
|
||
|
|
config: ConfigService,
|
||
|
|
jwtService: JwtService,
|
||
|
|
@Inject(CACHE_MANAGER) protected cache: Cache,
|
||
|
|
) {
|
||
|
|
super(
|
||
|
|
"oidc",
|
||
|
|
["oauth.oidc-enabled", "oauth.oidc-discoveryUri"],
|
||
|
|
config,
|
||
|
|
jwtService,
|
||
|
|
cache,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
protected getDiscoveryUri(): string {
|
||
|
|
return this.config.get("oauth.oidc-discoveryUri");
|
||
|
|
}
|
||
|
|
}
|