Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More work on the sample

  • Loading branch information...
commit 673b3c32541fe89dd4eab0188e00fcd7c70a9c51 1 parent 9cd3305
@user454322 authored
View
14 sample/src/main/java/info/modprobe/browserid/sample/servlet/In.java
@@ -14,10 +14,14 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
@WebServlet(value = "/in")
public class In extends HttpServlet {
private static final long serialVersionUID = -452837824924983487L;
+ private static final Logger log = LoggerFactory.getLogger(In.class);
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
@@ -32,16 +36,16 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
BrowserIDResponse personaResponse = verifier
.verify(assertion, audience);
Status status = personaResponse.getStatus();
- if (status == Status.OK) {
+ if (status == Status.OK) {
+ String email = personaResponse.getEmail();
+ log.info("{} has sucessfully signed in", email);
HttpSession session = req.getSession(true);
- session.setAttribute("email", personaResponse.getEmail());
-
- System.out.print("Here");
+ session.setAttribute("email", email);
out.print("okay");
} else {
+ log.info("Failed...");
out.print("failure");
- System.out.print("nnnn");
}
out.close();
View
4 sample/src/main/webapp/index.htm
@@ -1,6 +1,8 @@
<html>
<head>
<title>Sample</title>
+<script type="text/javascript"
+ src="http://code.jquery.com/jquery-2.0.2.min.js"></script>
</head>
<body>
@@ -25,8 +27,6 @@
-
-
<script src="https://login.persona.org/include.js"></script>
<script type="text/javascript">
Please sign in to comment.
Something went wrong with that request. Please try again.