Replies: 2 comments
-
|
Previus PR #20755 have a flaky test not related to this change. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Checklist for PRDiscussionStarted discussion as #20781 IssueOne feature/change per PRExactly one One commit per PRWIP Commit`git commit -m "OTP support for binary secrets encoded in Base32" -m "Closes #11561" -m "Closes https://github.com/keycloak/keycloak/issues/9434"`` WIP No changes to code not directly related to your PRI think so, there one line of change. Includes functional/integration testHas a functional test Includes documentationWIP Passing all testRunning tests local Test rewritten mvn -f testsuite/integration-arquillian/pom.xml clean install -Dtest=HmacTestTest not rewritten but could be affected mvn -f testsuite/integration-arquillian/pom.xml clean install -Dtest=LoginTotpTestCurrent PRPrevious PR with a test flanky |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Propose
I think with small fix various issues and discussions can be solved.
Motivation
There are various tries to import OTP from legacy system and then will fail because current implementation of HmacOTP function, as get a secret as String and invoke getBytes() on them. Then non-printable chars are returned as byte '?'/63.
keycloak/server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java
Line 115 in 3862f82
Some cases
The people envolved in theses cases have experience to develop SPI/RealmsResources or insert data directly on database, but was effortless because this (issue)[#motivation].
Implementation
The fix is implemeted at this line, with a check for "{B32}" prefix, triggering Base32.decode
Some tests
Some tests are:
Using own test base at
keycloak/server-spi-private/src/test/java/org/keycloak/models/HmacTest.java
Line 34 in d800947
Using a non-printable secret Base32.decode("CDLYAYRJ73ORTU4PUWWATWSYQCP4H2QL") from #11561
Values of code was generated from above B32 at https://totp.app/ on counters from last week..
PR
I already sent PR. as #20755
Beta Was this translation helpful? Give feedback.
All reactions