[Design Discussion] Revisit binding flows to an application and what the flow type is for #5494
Replies: 3 comments 2 replies
|
I like the overall idea, one concern is why we need to bring a new concept called |
|
+1 to the idea. Can't we use {
"handle": "customer-experience",
"nodes": [
{
"id": "start",
"type": "START",
"entries": [
- { "name": "signin", "nextNode": "prompt_credentials", "default": true },
+ { "handle": "signin", "nextNode": "prompt_credentials", "default": true },
...
]
}
]
} |
|
Hi @ThaminduDilshan, Two things that may need some consideration
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Related Feature Issue
#5493
Problem Summary
Currently an application binds a separate flow for each flow type. Authentication, registration, recovery and sign out each have their own config field.
applicationIdandflowType, and the type picks the binding.Concerns;
Two things to settle;
How an application binds to flows.
What the flow type is for.
Currently it serves 3 purposes:
High-Level Approach
Approach
The application binds one flow:
flowId.The flow declares its own entry points:
STARTcarries a list of entries in place of its singleonSuccess.CALLnode or into inline nodes.signin,signup,recoveryandsignoutrather than restricting to them.The client (at execution) names an entry instead of a type:
POST /flow/executetakesapplicationIdand an optionalentry.Three flow types remain, down from six:
AUTHENTICATIONAuthAssertExecutorCUSTOMADMINISTRATIONREGISTRATION,RECOVERYandSIGNOUTstop being types.CUSTOMflows an entry calls.USER_ONBOARDINGfolds intoADMINISTRATION.Validation is limited, but remains on the flow itself:
AUTHENTICATIONflow that is called.CALLto aCUSTOMflow is not validated.Other Considerations
Apps can bind sub flows directly as well:
flowTypestops doing two of its three jobs:flowId.Why collapse the four user facing types into one:
CredentialsAuthExecutoris required in both authentication and registration flows.Each entry carries its own initiation policy:
ADMINISTRATIONkeeps its own gate.Migration Impact
AUTHENTICATIONflow. ItsSTARThas one entry per old binding, each aCALLto the flow bound before.AUTHENTICATION,REGISTRATION,RECOVERY,SIGNOUT.onSuccessbecoming the default entry.CUSTOMunless they already produce an assertion.flowTypetoday:/flow/executeacceptsflowTypeas a deprecated alias forentry. Combined with the generated entry names above, existing clients keep working untouched.Architecture Overview
Application binding
{ "id": "<app-id>", "flow": "<customer-experience-flow>" // flow handle }Entry points on the flow
{ "handle": "customer-experience", "nodes": [ { "id": "start", "type": "START", "entries": [ { "name": "signin", "nextNode": "prompt_credentials", "default": true }, { "name": "signin-partner", "nextNode": "partner_screen" }, { "name": "signup", "nextNode": "signup_screen" }, { "name": "recovery", "nextNode": "recovery_screen" } ] } ] }CALLnode takes an optionalentrynaming which entry of the callee to run. Absent means the callee's default.onSuccessinto a single default entry.Shape 1: entries call other flows
Shape 2: everything in one flow
Flow execution
flowIdis read.entryto a start node, or the default entry.The server default flow, used when an application has no binding, becomes a single
AUTHENTICATIONflow with sign in, sign up and recovery entries.Configuration experience
STARTadds a row to the entry list. The row starts unnamed and the flow stays invalid until it's named.STARTopens the node properties panel. A row is an entry name plus a target node, and adefaultchip marks the default, which can't be removed while it holds that role.Flow onboarding experience
Flow creation changes too, since the composer asks for a type before a flow exists and templates are cut by type.
AUTHENTICATIONorCUSTOM.AUTHENTICATIONflow.Executor behaviour
9 executors branch on
ctx.FlowType. Most branches can be deleted rather than moved.Deleted, because the condition is already expressed elsewhere;
OAuthExecutor,OIDCAuthExecutor,OpenID4VPVerifyExecutor. Each arm is already gated onallowAuthenticationWithoutLocalUserorallowRegistrationWithExistingUser.AttributeCollector. It skips itself in a registration flow. It can determine this at runtime based on the user existence.AuthorizationExecutor. Dropping the type leaves the same behaviour.CredentialsAuthExecutor. Its registration arm checks the user doesn't exist then sets a credential, whichIdentifyingExecutorandCredentialSetteralready do.Kept, as an explicit node property;
ProvisioningExecutor, just in time behind a federated sign in against explicit provisioning.OTPExecutorandMagicLinkExecutor, recipient from an existing user's attribute against a value declared on the node.Ideally these three can derive it from whether a user exists at runtime. If not possible, reusing
allowAuthenticationWithoutLocalUserandallowRegistrationWithExistingUseris a possibility.If the user detection can be centralized, interceptor is where to put it.
Validation
AUTHENTICATIONflow must contain anAuthAssertExecutor, inline or through aCALLto anotherAUTHENTICATIONflow.SupportedFlowTypesis executor metadata and keeps its shape, now restricted to the three remaining types. Its registration, recovery and sign out rules go.Storage
UNIQUE (HANDLE, FLOW_TYPE, DEPLOYMENT_ID)becomesUNIQUE (HANDLE, DEPLOYMENT_ID).Security Considerations
flowIdpath.Impacted Areas
flowTypebecomes an entry nameflowTypeAlternatives Considered
1. A flow set resource
A new resource groups flows and holds the entry names. The application binds one set, and a call target has to be a member of the same set.
Payloads
Flows stay small and a set is reusable across applications, which is also where the reusable token config from #5219 could live.
Against it: a new resource, console section and declarative kind, two hops to resolve a flow, and a set needed even for one login flow. A set is passive, so a landing screen that lets the user pick still needs a flow.
2. A pool of flows on the application
The application holds a list of flows with no names, and the client names the flow by handle.
Payloads
Simplest data model, but a handle is not unique on its own, clients would depend on admin side handles, and there is no default. Adding a default marker turns it into the flow set with fewer features.
3. Named entry points on the application
Replace the typed fields with a
flowsmap keyed by entry name. This only addresses the schema growth. The application still binds several flows so call targets have to be reconciled, and a root flow still can't be expressed.Questions for Community Input
Is
AUTHENTICATIONthe right name for the one type an application or an agent binds? The flow it names now also covers sign up and recovery.AUTHENTICATION(suggested): No new word and it already means "the flow an app binds". Understates the rest.ACCESS: Covers sign in, sign up and recovery as ways to get access, but is a new term.APPLICATION: An agent binds one too, so maybe need aAGENTtype as well and with this apps and agents can't share the same flow.Does an application need to disable individual entries on a shared flow?
isRegistrationFlowEnableddoes this today.Two paths if needed;
Suggested: on the application, since that is what the enabled flags already are.
Is sign out an entry next to sign in, or a separate binding? It's the one entry with no path from the rest of the graph.
All reactions