|
|
|
@ -45,14 +45,16 @@ public final class GenerateOneTimeTokenFilter extends OncePerRequestFilter { |
|
|
|
|
|
|
|
|
|
|
|
private final OneTimeTokenService oneTimeTokenService; |
|
|
|
private final OneTimeTokenService oneTimeTokenService; |
|
|
|
|
|
|
|
|
|
|
|
private RequestMatcher requestMatcher = antMatcher(HttpMethod.POST, "/ott/generate"); |
|
|
|
private final GeneratedOneTimeTokenHandler generatedOneTimeTokenHandler; |
|
|
|
|
|
|
|
|
|
|
|
private GeneratedOneTimeTokenHandler generatedOneTimeTokenHandler = new RedirectGeneratedOneTimeTokenHandler( |
|
|
|
private RequestMatcher requestMatcher = antMatcher(HttpMethod.POST, "/ott/generate"); |
|
|
|
"/login/ott"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GenerateOneTimeTokenFilter(OneTimeTokenService oneTimeTokenService) { |
|
|
|
public GenerateOneTimeTokenFilter(OneTimeTokenService oneTimeTokenService, |
|
|
|
|
|
|
|
GeneratedOneTimeTokenHandler generatedOneTimeTokenHandler) { |
|
|
|
Assert.notNull(oneTimeTokenService, "oneTimeTokenService cannot be null"); |
|
|
|
Assert.notNull(oneTimeTokenService, "oneTimeTokenService cannot be null"); |
|
|
|
|
|
|
|
Assert.notNull(generatedOneTimeTokenHandler, "generatedOneTimeTokenHandler cannot be null"); |
|
|
|
this.oneTimeTokenService = oneTimeTokenService; |
|
|
|
this.oneTimeTokenService = oneTimeTokenService; |
|
|
|
|
|
|
|
this.generatedOneTimeTokenHandler = generatedOneTimeTokenHandler; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -81,14 +83,4 @@ public final class GenerateOneTimeTokenFilter extends OncePerRequestFilter { |
|
|
|
this.requestMatcher = requestMatcher; |
|
|
|
this.requestMatcher = requestMatcher; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Specifies {@link GeneratedOneTimeTokenHandler} to be used to handle generated |
|
|
|
|
|
|
|
* one-time tokens |
|
|
|
|
|
|
|
* @param generatedOneTimeTokenHandler |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setGeneratedOneTimeTokenHandler(GeneratedOneTimeTokenHandler generatedOneTimeTokenHandler) { |
|
|
|
|
|
|
|
Assert.notNull(generatedOneTimeTokenHandler, "generatedOneTimeTokenHandler cannot be null"); |
|
|
|
|
|
|
|
this.generatedOneTimeTokenHandler = generatedOneTimeTokenHandler; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|