Rolando
Rolando

Reputation: 62634

Any alternatives to JSPs for open-id authentication in java Spring web applications?

I am interested in making some sort of HTML page that displays the name of a user that was authetnicated through some openid authentication mechanism. I noticed the example in many places I see uses something like:

"j_spring_openid_security_check"

Ive read that JSPs are not recommended for web applications as JSFs are much more popular and I would like to if possible stick with standard HTML. Is there some way to be able to authenticate some other means by maybe calling some sort of service through some GET or POST to get the identity of the user so I wouldnt have to rely on JSPs for my web application?

Any examples/guides/approaches would be great.

Upvotes: 0

Views: 99

Answers (2)

sanek
sanek

Reputation: 86

This is example from my project of clean html text with username/password and openid login forms.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body style="width: 100%; height: 100%">
<div style="width: 100%; vertical-align: middle; height: 100%; border: 1px solid red" align="center">
    <form style="border: 1px solid red" action="../j_spring_security_check" method="post">
        <p>
            <label for="j_username">Username</label> <input id="j_username" name="j_username" type="text" />
        </p>
        <p>
            <label for="j_password">Password</label> <input id="j_password" name="j_password" type="password" />
        </p>
        <input type="submit" value="Login" />
    </form>
    <form action="../j_spring_openid_security_check" method="post">
        For Google users: <input name="openid_identifier" type="hidden" value="https://www.google.com/accounts/o8/id" /> <input type="submit" value="Sign with Google" />
    </form>
</div>
</body>
</html>

You have to change code

 <action="../j_spring_security_check">     

Upvotes: 0

DeejUK
DeejUK

Reputation: 13481

You can use a multitude of technologies as views in Spring MVC, as mentioned in the documentation. If you're really set against JSPs, you could use Velocity or Freemarker templates, but there are plenty of successful enterprise applications that use JSPs as their view technologies: the Amazon Web Services forums being but one example.

Upvotes: 1

Related Questions