Skip to content

Instantly share code, notes, and snippets.

@cbmeeks
Created May 31, 2011 12:16
Show Gist options
  • Save cbmeeks/1000409 to your computer and use it in GitHub Desktop.
Save cbmeeks/1000409 to your computer and use it in GitHub Desktop.
Pentaho Http Auth
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