Skip to content

Commit

Permalink
Make externalAuthenticationType configurable (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
adusumillipraveen committed Aug 2, 2023
1 parent 7f22bb0 commit 1a4bfb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions apps.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"https://raw.githubusercontent.com/hmcts/azure-app-proxy/main/logos/incident-bot.png"
]
},
"externalAuthenticationType": {
"type": "string",
"default": "aadPreAuthentication",
"title": "externalAuthenticationType to be set on application onPremisesPublishing setting. Defaults to aadPreAuthentication ",
"examples": ["passthru"]
},
"groupMembershipClaims": {
"type": "string",
"default": "",
Expand Down
5 changes: 3 additions & 2 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Application } from "./application.js";

// TODO merge with config
export function defaultOnPremisesFlags(): {
externalAuthenticationType: "aadPreAuthentication";
isHttpOnlyCookieEnabled: boolean;
isOnPremPublishingEnabled: boolean;
isPersistentCookieEnabled: boolean;
Expand All @@ -13,7 +12,6 @@ export function defaultOnPremisesFlags(): {
isTranslateLinksInBodyEnabled: boolean;
} {
return {
externalAuthenticationType: "aadPreAuthentication",
isHttpOnlyCookieEnabled: true,
isOnPremPublishingEnabled: true,
isPersistentCookieEnabled: true,
Expand Down Expand Up @@ -43,6 +41,9 @@ export async function loadApps(configFilePath: string): Promise<Application[]> {
onPremisesPublishing: {
externalUrl: app.externalUrl,
internalUrl: app.internalUrl,
externalAuthenticationType: app.externalAuthenticationType
? app.externalAuthenticationType
: "aadPreAuthentication",
...defaultOnPremisesFlags(),
},
groupMembershipClaims: app.groupMembershipClaims,
Expand Down
2 changes: 1 addition & 1 deletion src/onPremisesPublishing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type OnPremisesPublishing = {
externalAuthenticationType: "aadPreAuthentication";
externalAuthenticationType: string;
externalUrl: string;
internalUrl: string;
isHttpOnlyCookieEnabled: boolean;
Expand Down

0 comments on commit 1a4bfb9

Please sign in to comment.