Created
May 31, 2011 12:16
-
-
Save cbmeeks/1000409 to your computer and use it in GitHub Desktop.
Pentaho Http Auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionForward execute(ActionMapping mapping, ActionForm form, | |
HttpServletRequest request, HttpServletResponse response) throws Exception { | |
// joe:password = Authorization: Basic am9lOnBhc3N3b3Jk | |
String user = "joe"; | |
String pass = "password"; | |
String headerValue = "Basic " + Base64.encodeString(user + ":" + pass); | |
response.setHeader("Authorization", headerValue); | |
response.sendRedirect("http://ourserver:8081/pentaho/Home"); | |
return mapping.findForward(SUCCESS); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment