Skip to content

Commit

Permalink
sebankid supports the message parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhansen committed May 13, 2024
1 parent 583e5f1 commit 4d40e54
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
21 changes: 20 additions & 1 deletion src/components/AuthMethodButton/AuthMethodButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@ export default {
control: 'select',
defaultValue: 'token',
options: ['token', 'code']
}
},
action: {
name: 'Action',
control: 'select',
defaultValue: undefined,
options: ['confirm', 'accept', 'approve', 'sign', 'login']
},
message: {
name: 'Message (Danish MitID + Swedish BankID)',
control: 'text',
defaultValue: undefined
},
loginHint: {
name: 'Login hint',
control: 'text',
defaultValue: undefined
},
}
} as ComponentMeta<typeof AuthMethodButton>;

Expand All @@ -35,6 +51,9 @@ const Template: ComponentStory<typeof AuthMethodButton> = (args, {globals}) => {
domain={globals.domain}
clientID={globals.clientID}
redirectUri={window.location.href}
action={(args as any).action}
message={(args as any).message}
loginHint={(args as any).loginHint}
prompt="login"
>
<StoryResponseRenderer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
options: ['confirm', 'accept', 'approve', 'sign', 'login']
},
message: {
name: 'Message (Danish MitID)',
name: 'Message (Danish MitID + Swedish BankID)',
control: 'text',
defaultValue: undefined
},
Expand Down
5 changes: 4 additions & 1 deletion src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export const ACTION_SUPPORTING_ACR_VALUES = [
export const MESSAGE_SUPPORTING_ACR_VALUES = [
'urn:grn:authn:dk:mitid:low',
'urn:grn:authn:dk:mitid:substantial',
'urn:grn:authn:dk:mitid:high'
'urn:grn:authn:dk:mitid:high',
'urn:grn:authn:se:bankid:same-device',
'urn:grn:authn:se:bankid:another-device',
'urn:grn:authn:se:bankid:another-device:qr'
];

export function buildLoginHint(loginHint: string | undefined | null, params: {options?: AuthorizeUrlParamsOptional, action?: Action, message?: string}) {
Expand Down

0 comments on commit 4d40e54

Please sign in to comment.