Keycloak email template with frontend url - keycloak

Is it possible to get the Frontend url defined on the Realm Settings and pass it to the kcSanitize method to be used in the keycloak email template, for example:
password-reset.ftl:
${kcSanitize(msg("passwordResetBodyHtml", frontEndUrl, link, linkExpiration, realmName, linkExpirationFormatter(linkExpiration), user.getFirstName(), user.getLastName(), user.getEmail()))?no_esc}
message.properties:
passwordResetBodyHtml: Frontend Url {0}

As far as I understand the source code you can only access the realmName. I helped myself in a similar situation by defining a variable in the theme.properties for example
myLoginURL=${env.MY_LOGIN_URL}
and in your template you can access this as
<a class="zocial" href="${properties.myLoginURL}">

Related

keycloak email template use client base url

I am trying to use client base url or realm frontend url in requiredActions.ftl and password-reset.ftl. How can I do that? I cant use theme properties as we only have one keycloak instance with different realms as environments and I will use same email theme for these environments but base urls will change across these realms/clients.
My tried ideas:
client.getBaseUrl
session.getContext.getClient.getBaseUrl
these didnt work out. I only want to use this realm/client base url to generate my new password reset link which will use base url and user id.

Aqueduct template db_and_auth not rendering login form

I am working on setting up OAuth 2.0 for aqueduct and want to start with a working example. The template db_and_auth is suppose to serve this purpose.
I have followed the readme instructions and connected my database and updated the migration. also I have registered OAuth 2.0 clients in the application database as the readme describes.
The template comes with a route in the channel.dart
router
.route("/auth/form")
.link(() => AuthRedirectController(authServer, delegate: this));
The AuthRedirectController is set up to render a html page (web/login.html) which is part of the template.
However every time I send a get request to this route it returns with a 400 error saying Error
unsupported_response_type in the browser. Additionally in the readme file it only shows testing auth end points using curl. Why would this template include a rendered login page without mention of it in the readme? Any help with this would be much appreciated.
The login form will only be rendered when you pass the correct response_type like so:
http://localhost:8888/auth/form?response_type=token

SharePoint Online: Redirect URIs for multi-site environment

We have a multi-site environment where each site has its own redirect URL. We want to use a single Client ID and Secret for our application but register multiple redirect URIs to it. Is it possible to add multiple URLs in below registration form:
I don't think there is possible solution to add on multiple URLs on the SharePoint online app registration form.
But from what i understand there is another way to achieve use a single Client ID and Secret for application and perform multiple redirects.
You can control the redirect url using the appredirect.aspx by specifying the redirect_uri parameter if you need to redirect from the default one check here for reference.
Basiclly it call the subsite page containing the below JS to install the app.
var url = String.format(
"{0}/_layouts/15/appredirect.aspx?client_id={1}&redirect_uri=https://***.azurewebsites.net/<<controller>>/<<view method containing the code to install the app>>?{{StandardTokens}}",
<<subsite url>>, "<<client id>>");
window.location.href = url;
The above javascript calls the appredirect.aspx page which then calls the app site as below,
https://****.azurewebsites.net/home?SPHostUrl=<<subsiteurl>>&SPLanguage=en-US&SPClientTag=1&SPProductNumber=**&SPAppWebUrl=<<weburl>>
Note: The above can be extended to check for the successful installation of the app and display an error message accordingly.
SPWeb.LoadAndInstallWeb equivalent REST / Javascript CSOM is also available here.
Here are some relevant links:
Use the redirect URL in an add-in that asks for permissions on the fly
Redirect URIs and a sample redirect page

Prepopulating Fields to jhipster form via URL Parameters

Hello Jhipster community
i would like to know if there is a way to populate form in jhipster through url parameter
for instance jhispter has generated for myentity a form callable by
http://localhost:8080/#/shipment(popup:shipment-new)
is there a way to prefilled it?
http://localhost:8080/#/myentity(popup:myentity-new)?name=new
Thanks
I'm guessing looking at the url that you're using the Angular frontend.
You can retrieve that kind of data from via the ActivatedRoute service. Properties params and queryParams should provide you the data you're looking and let you populate your template.

Drupal 7 - accessing content through url alias over ReST

I have a Drupal 7 with Pathauto and restws modules. I am able to configure Pathauto module to create a url alias for my content type so now the content that I could access with url http://mycms.org/mydrupal/node/4 is accessible using http://mycms.org/mydrupal/content/1-sampleID.
Also, I am able to access the content over ReST using http://mycms.org/mydrupal/node/4.json.
However i need to access the content over ReST api using the url alias, say, http://mycms.org/mydrupal/content/1-sampleID.json. When I try doing this, I get a 404 error.
I am new to Drupal and PHP. Can someone please help me fix this issue? Do I need some custom Drupal module that could help me expose my contents over ReST api through the defined url aliases.
I use the RESTful module, and here's a blog post on how to do what you need.