Adding a custom url parameter to user Required Action URL Keycloak - keycloak

I am using a custom url parameter(theme) in order to set the theme for the Keycloak login pages and I can't find a way to add it to the URLs for the Required User actions such as 2FA or Email Verification. I set the theme name as kcCurrentTheme in the theme.properties file from my custom theme and I managed to add it to the Forgot Password URL by modifying the login.ftl file.
<span><a tabindex="5" href="${url.loginResetCredentialsUrl}&theme=${properties.kcCurrentTheme}">${msg("doForgotPassword")}</a></span>
I tried adding the parameter also to the login action button but the parameter is not passed to the required user action pages.
<form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}&theme=${properties.kcCurrentTheme}" method="post">
Is there a way to achieve this?

Related

making a custom login in auth0 to authenticate using a rest API call

I want to make a custom login page using auth0 (where I can modify the default fields required for login)
and validate the credential by requesting a rest API.
I was working on auth0 and found a fix.
Note: this may not be the exact method to make a custom login page but it worked for me.
Here are the steps to be followed to design a custom login in auth0.
Step 1: If you need to change some fields required during login, Go to Hosted Pages in auth0 console. Otherwise, directly go to Step 4.
Step 2: Under the login tab, switch to Customize Login Page and then set Custom Login Form from the Default Templates dropdown.
Step 3: Here you need to edit the code to modify the fields.
After editing in the script, make sure to set the databaseConnection name to your custom Connection you are using.
// var databaseConnection = 'Username-Password-Authentication';
// change this to
var databaseConnection = 'your-connection-name';
Step 4: After doing this, head over to your custom database connection in the auth0 console. Go under Custom Database tab and switch to Use my own database.
Step 5: Under the login tab, select Request with basic Auth in the Templates dropdown.
Step 6: Now you can edit the login function and request the rest API.

How to do a form submit in moodle from some other page?

In moodle, when you go to Quiz Administration-> User overrides -> Add user override, you get a form (overrideedit.php) to add the details of the user override to be created.
You need to fill that form and submit it. After you submit, the form is processed (in overrideedit.php itself) and then you are redirected to overrides.php page.
Now, I want that form to take post data from my plugin and process it in overrideedit.php and do the redirect.
How do I send post data in this case from my plugin?
You could set a different action for the form you're having in your plugin (this assumes you are using Moodle Form API for your custom form):
// Instantiate your form
// Data will be submitted to /mod/quiz/overrideedit.php
$mform = new custom_form_your_are_having(new moodle_url('/mod/quiz/overrideedit.php'));
Or simply change the action attribute of your custom for to point to /mod/quiz/overrideedit.php:
<form action="/mod/quiz/overrideedit.php" method="post">
...
</form>

How to set logout redirect in felogin plugin in TYPO3 6.2?

I'm using felogin - to get it to work I set it up in TypoScript in my root template:
plugin.tx_felogin_pi1 {
storagePid = 40,38,36,35,51
showForgotPasswordLink = 1
redirectMode = groupLogin,userLogin,login,loginError
redirectPageLogout = 6
...
It works fine, except when I try to logout while being on a page with restricted access because then it tries to find that restricted-page and for those cases I set up the install tool to redirect it to a "Page not found" template.
I noticed the logout-form action always points to the page ID I'm currently on:
<form action="index.php?id=49" target="_top" method="post">
so that's not what I want...I would like it to always be action="index.php?id=6" but my redirectPageLogout = 6 line didn't manage to change it.
Anyone an idea how can I change this?
In the felogin html template there's just ###ACTION_URI### and idk where it gets that from in the logout-form but I wanna play by the rules and not change it in the template directly...unless there's no other way.
You need to have access to a login-/logout-plugin after your logout is processed to get the forwarding working.
So if your logout plugin is on a page which is only invisible for logged in user. the logout is processed, but your redirect can't be processed (the default-handling of TYPO3 takes over and throws you to a page which is accessable). The same occurs if only the plugin itself is only visible for logged in users.
if you target the logout form directly to a page with a plugin visible for all, first the logout and secondly the redirect can be processed always.

OctoberCMS: how to setup user account activation by email in Rainlab.User plugin?

I'm using Rainlab.User plugin with user activation via e-mail.
By default user receives an email with activation link "http://examples.com/register". So there is no activation code in it. How it is supposed to work at all?
Perhaps you forgot to set the url parameter on the page where the Account component is placed?
The page url needs something like: register/:code?
And the component settings must reflect that with the 'Activation Code Param' set to code as a normal string.

Email async validation with facebook registration form

As facebook says
For privacy reasons, the input to your function will be only the custom fields you requested, on blur or submit.
Indeed email is not custom field but when user clicks on "x" (cross) to fill details manually then still form.email remain undefined ?
Is this a facebook bug , is there any fix/ solution for it ?
Well I have found a fix for it by using 'view' property
In fields list I added
fields="[
{'name':'email','view':'prefilled'},
{'name':'xemail','view': 'not_prefilled','description':'Email Address:','type':'text'}]";
Now email is used with fb and xemail is used without fb and my async validators which are needed in case of without fb uses form.xemail.