or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

authentication-components.mdevent-resolution.mdindex.mdprovider-selection.mdwebflow-actions.mdwebflow-configuration.mdwebflow-utilities.md

webflow-configuration.mddocs/

0

# Webflow Configuration

1

2

Core interfaces and base classes for configuring MFA webflows and integrating MFA providers into the CAS authentication flow. These components provide the foundation for registering custom MFA providers and customizing webflow behavior.

3

4

## Capabilities

5

6

### CasMultifactorWebflowConfigurer Interface

7

8

Main interface defining the contract for configuring multifactor authentication webflows.

9

10

```java { .api }

11

/**

12

* Interface for configuring multifactor authentication webflows

13

*/

14

public interface CasMultifactorWebflowConfigurer {

15

16

/**

17

* Register multifactor provider authentication webflow

18

* @param flow The parent flow to register the MFA subflow into

19

* @param subflowId The ID of the subflow state

20

* @param providerId The ID of the MFA provider

21

*/

22

void registerMultifactorProviderAuthenticationWebflow(Flow flow, String subflowId, String providerId);

23

24

/**

25

* Register multifactor provider authentication webflow with provider ID as subflow ID

26

* @param flow The parent flow to register the MFA subflow into

27

* @param providerId The ID of the MFA provider (used as both provider and subflow ID)

28

*/

29

default void registerMultifactorProviderAuthenticationWebflow(Flow flow, String providerId) {

30

registerMultifactorProviderAuthenticationWebflow(flow, providerId, providerId);

31

}

32

33

/**

34

* Determine the order of the configurer

35

* @return Order value for configurer execution sequence

36

*/

37

int getOrder();

38

39

/**

40

* Collection of flow definition registries tied to this MFA flow

41

* @return List of flow definition registries

42

*/

43

List<FlowDefinitionRegistry> getMultifactorAuthenticationFlowDefinitionRegistries();

44

}

45

```

46

47

### AbstractCasMultifactorWebflowConfigurer

48

49

Base implementation providing common functionality for MFA webflow configuration.

50

51

```java { .api }

52

/**

53

* Abstract base class for MFA webflow configurers providing entry point into CAS webflow

54

*/

55

public abstract class AbstractCasMultifactorWebflowConfigurer extends AbstractCasWebflowConfigurer

56

implements CasMultifactorWebflowConfigurer {

57

58

/**

59

* Constructor for single MFA flow definition registry

60

*/

61

protected AbstractCasMultifactorWebflowConfigurer(

62

FlowBuilderServices flowBuilderServices,

63

FlowDefinitionRegistry flowDefinitionRegistry,

64

ConfigurableApplicationContext applicationContext,

65

CasConfigurationProperties casProperties,

66

Optional<FlowDefinitionRegistry> mfaFlowDefinitionRegistry,

67

List<CasMultifactorWebflowCustomizer> mfaFlowCustomizers);

68

69

/**

70

* Register multifactor provider authentication webflow

71

* @param flow The parent flow

72

* @param subflowId The subflow state ID

73

* @param providerId The MFA provider ID

74

*/

75

@Override

76

public void registerMultifactorProviderAuthenticationWebflow(Flow flow, String subflowId, String providerId);

77

78

/**

79

* Get flow definition registries for this MFA configurer

80

* @return List of FlowDefinitionRegistry instances

81

*/

82

@Override

83

public List<FlowDefinitionRegistry> getMultifactorAuthenticationFlowDefinitionRegistries();

84

85

/**

86

* Get execution order for this configurer

87

* @return Order value (defaults to LOWEST_PRECEDENCE)

88

*/

89

@Override

90

public int getOrder();

91

}

92

```

93

94

**Usage Example:**

95

96

```java

97

@Configuration

98

public class MyMfaWebflowConfiguration {

99

100

@Bean

101

public CasMultifactorWebflowConfigurer myMfaWebflowConfigurer(

102

@Qualifier("flowBuilderServices") FlowBuilderServices flowBuilderServices,

103

@Qualifier("loginFlowRegistry") FlowDefinitionRegistry loginFlowDefinitionRegistry,

104

ConfigurableApplicationContext applicationContext,

105

CasConfigurationProperties casProperties,

106

@Qualifier("myMfaFlowRegistry") FlowDefinitionRegistry myMfaFlowRegistry,

107

List<CasMultifactorWebflowCustomizer> mfaFlowCustomizers) {

108

109

return new MyMfaWebflowConfigurer(flowBuilderServices, loginFlowDefinitionRegistry,

110

applicationContext, casProperties, Optional.of(myMfaFlowRegistry), mfaFlowCustomizers);

111

}

112

}

113

114

public class MyMfaWebflowConfigurer extends AbstractCasMultifactorWebflowConfigurer {

115

116

public MyMfaWebflowConfigurer(

117

FlowBuilderServices flowBuilderServices,

118

FlowDefinitionRegistry flowDefinitionRegistry,

119

ConfigurableApplicationContext applicationContext,

120

CasConfigurationProperties casProperties,

121

Optional<FlowDefinitionRegistry> mfaFlowDefinitionRegistry,

122

List<CasMultifactorWebflowCustomizer> mfaFlowCustomizers) {

123

super(flowBuilderServices, flowDefinitionRegistry, applicationContext,

124

casProperties, mfaFlowDefinitionRegistry, mfaFlowCustomizers);

125

}

126

127

@Override

128

protected void doInitialize() {

129

val loginFlow = getLoginFlow();

130

if (loginFlow != null) {

131

registerMultifactorProviderAuthenticationWebflow(loginFlow, "myMfaProvider");

132

}

133

}

134

}

135

```

136

137

### CasMultifactorWebflowCustomizer Interface

138

139

Interface for customizing multifactor authentication webflows with additional states and attribute mappings.

140

141

```java { .api }

142

/**

143

* Interface extending CasWebflowCustomizer for MFA-specific customizations

144

*/

145

public interface CasMultifactorWebflowCustomizer extends CasWebflowCustomizer {

146

147

/**

148

* Get candidate states for multifactor authentication

149

* @return Collection of state IDs that are candidates for MFA integration

150

*/

151

default Collection<String> getCandidateStatesForMultifactorAuthentication() {

152

return List.of();

153

}

154

}

155

```

156

157

### CompositeProviderSelectionMultifactorWebflowConfigurer

158

159

Configurer for composite multifactor authentication provider selection scenarios.

160

161

```java { .api }

162

/**

163

* Configures webflow for composite MFA provider selection

164

*/

165

public class CompositeProviderSelectionMultifactorWebflowConfigurer

166

extends AbstractCasMultifactorWebflowConfigurer {

167

168

/**

169

* Constructor

170

*/

171

public CompositeProviderSelectionMultifactorWebflowConfigurer(

172

FlowBuilderServices flowBuilderServices,

173

FlowDefinitionRegistry flowDefinitionRegistry,

174

ConfigurableApplicationContext applicationContext,

175

CasConfigurationProperties casProperties);

176

177

/**

178

* Initialize composite provider selection webflow configuration

179

*/

180

@Override

181

protected void doInitialize();

182

}

183

```

184

185

### MultifactorAuthenticationAccountProfileWebflowConfigurer

186

187

Configurer for MFA-related components in user account profile management flows.

188

189

```java { .api }

190

/**

191

* Configures MFA components for user account profile management flows

192

*/

193

public class MultifactorAuthenticationAccountProfileWebflowConfigurer

194

extends AbstractCasWebflowConfigurer {

195

196

/**

197

* Constructor

198

*/

199

public MultifactorAuthenticationAccountProfileWebflowConfigurer(

200

FlowBuilderServices flowBuilderServices,

201

FlowDefinitionRegistry flowDefinitionRegistry,

202

ConfigurableApplicationContext applicationContext,

203

CasConfigurationProperties casProperties);

204

205

/**

206

* Initialize account profile MFA webflow configuration

207

*/

208

@Override

209

protected void doInitialize();

210

}

211

```

212

213

## Implementation Guidelines

214

215

1. **Extend AbstractCasMultifactorWebflowConfigurer** for new MFA provider integrations

216

2. **Override doInitialize()** to perform webflow registration logic

217

3. **Use registerMultifactorProviderAuthenticationWebflow()** to integrate your MFA flow

218

4. **Set appropriate order** using setOrder() if execution sequence matters

219

5. **Implement CasMultifactorWebflowCustomizer** for additional webflow customizations