Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add conditional login passkeys #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waynemorphic
Copy link

Code review on this feature is highly welcome.

Keycloak reference

@OOub
Copy link

OOub commented Jul 23, 2024

I'm looking into this feature as well and when I try this I get this error

Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> authenticators  [in template "login-passkeys-conditional-authenticate.ftl" at line 117, column 45]

Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${authenticators}  [in template "login-passkeys-conditional-authenticate.ftl" at line 117, column 43]
	~ Reached through: #nested "form"  [in template "template.ftl" in macro "registrationLayout" at line 45, column 5]
	~ Reached through: @layout.registrationLayout script="di...  [in template "login-passkeys-conditional-authenticate.ftl" at line 8, column 1]
----
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:370)
	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
	at freemarker.core.Environment.visit(Environment.java:335)
	at freemarker.core.Environment.visit(Environment.java:377)
	at freemarker.core.Environment.invokeNestedContent(Environment.java:621)
	at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
	at freemarker.core.Environment.visit(Environment.java:371)
	at freemarker.core.Environment.visit(Environment.java:398)
	at freemarker.core.BlockAssignment.accept(BlockAssignment.java:55)
	at freemarker.core.Environment.visit(Environment.java:371)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:877)
	at freemarker.core.Environment.invokeMacro(Environment.java:813)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
	at freemarker.core.Environment.visit(Environment.java:335)
	at freemarker.core.Environment.visit(Environment.java:341)
	at freemarker.core.Environment.process(Environment.java:314)
	at freemarker.template.Template.process(Template.java:383)
	at org.keycloak.theme.freemarker.DefaultFreeMarkerProvider.processTemplate(DefaultFreeMarkerProvider.java:49)
	... 21 more

@waynemorphic
Copy link
Author

@OOub thank you for your input on this. Yes, that error is expected. You could delete that line since this will remove that error. Alternatively, how could that section of the script be improved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants