I'm working with spring security and thymeleaf ,i want to hide the logout link if user is not authenticated and i don't know how to do that.
Could anyone please help me?
Thanks.
Enclose your page content (what you want to hide) in this (sec:authorize="isAuthenticated()") tag, like below:
<div sec:authorize="isAuthenticated()">
< Hide your stuff here >
</div>
Related
I'm newbie in using CAS and wanted to add a custom jsp page to the server after the login page and before it redirects to the client after successful login. I searched and thought that this would be done by adding the jsp page say Test.jsp in /WEB-INF/view/jsp/default/ui/Test.jsp and then changing the login-webflow.xml but i have little knowledge of Spring framework and failed in implementing using this technique as it redirected as usual, I wanted to know what all steps i'm missing or what would be the correct way to do it. Thanks in Advance.
I tried to make any customization to Google no CAPTCHA reCAPTCHA and failed.
The main thing that I want to do is to change its width, height, and color.
Can any one help me please.
The noCaptcha reCaptcha client code is an iframe.
You can just choose between dark and light Google provided themes.
UPDATE: You cannot modify the content inside an iframe, unless it's the same domain. Some services let you pass parameters in the url query, but this is not the case.
I also faced same problem with google new captcha but this trick worked fine for me.
<div class="g-recaptcha" data-theme="light" id="google-captcha" data-sitekey="yoursecretkey" style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>
You can also check this link for more information. I hope this will help some one.
I have found really lot of examples, how to make spring security custom logging page and how to configure redirect to it if authorization is needed.
But I can’t find how to make logging form inside another page, for example inside home.html.
I can imagine I will use Thymeleaf fragments to insert custom logging page inside home page. But I don’t know how to connect it to authentication process (also without any redirection to home.html)
Thank you for replies
Petr
I have started a meteor application using the accounts packages for facebook, twitter, github and auth accounts. For UI, I am using the bootstrap package. Whenevee I load my site projectx.meteor.com, the login links take some time
I have everything static on the HTML page, except for the link to login:
client/x.html:
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li>{{loginButtons}}</li>
</ul>
</div>
There is no JS on the client side and I have called the startup method on the server.
Server/startup.js:
Meteor.startup(function () {
});
Also, when I visit the above URL from IE 9 on my Windows Phone 7.5, it doesn't show the login link at all.
Update: After the comment below, I modified my code to remove packages and additional HTML. The packages now included are:
preserve-inputs
accounts-ui
accounts-password
accounts-facebook
accounts-twitter
accounts-github
I have removed bootstrap and the only thing on my template now is {{loginButtons}}, It still loads the login link after a delay. Is this the default behavior of the accounts package ?
The reason why the buttons take so long to load is because Meteor has to ask the server-side for the necessary configuration information (located in a collection in your Mongo instance) before it can render the login buttons for each of the external services you want to use. I think the best solution (and the solution I use) is to simply build the buttons client-side if you want faster results or tweak the login buttons template to allow for data ported in from the client-side using a JSON object with all the OAuth keys it needs.
As you say, this is the default behavior.
There is no problem about bootstrap or js in your code.
I cant explain exactly why but it works that way.
I have a website and users who have registered on my site by using FBConnect to login.
As they're authenticated with my app I have access to their profile from PHP and from JS.
I'm trying to render the multi-friend-invite with FBML and nothing is happening.
I'm trying to build a "refer your friends" page and render a multi-friend-invite widget on our webpage.
Can someone give me some advice? The FBML i'm using is not being modified in the DOM at all.
I've tried a direct FB.XFBML.parse() call on the surrounding <div> and it's still doing nothing.
Help?