I´m new in keycloak. We have an angular application that use keycloak service to log in and to get some user attributes that we already configured but now i have to check if keycloak OTP required action is enable because if it´s enable I had to show a button to redirect users to the topt.ftl to scan the QRcode given by keycloak. Otherwise button must be hidden.
I´ve been looking for information but I didn't find anything relevant. Any documentation or clue to find out would be great. Thank you!
I tried to use keycloakService npm library to access totp, i found that if you instance this service like:
this.keycloakService.getKeycloakInstance()
there is an object name "profile" and it is KeycloakProfile type: into this object ther is an attribute called topt?, I called the method, then I printed the response and it was:
keycloak-profile {"username":"srueda@ec.krugercorp.com","firstName":"JHOANN","lastName":"RUEDA","email":"srueda@ec.krugercorp.com","emailVerified":true,"attributes":{"secondLastName":["VANEGAS"],"termsAccepted":["TCU##PPR"],"secondName":["SEBASTIAN"]}} 58410ae9-331c-4b1c-9992-4c49368efc83
It shows the attributes from the user.