I try to use Basic Authentication to make a login into Pentaho by using .NET code, so that I no need to login to user console again
My .NET code is:
Dim request = WebRequest.Create("http://x.x.x.x:8080/pentaho/Home")
Dim authInfo As String = Convert.ToString(userName) & ":" & Convert.ToString(userPassword)authInfo = Convert.ToBase64String(Encoding.[Default].GetBytes(authInfo))
request.Headers("Authorization") = "Basic " & authInfo
Dim response As WebResponse = request.GetResponse()
You can see that I pass the authorization header with Basic username: password with Base64 encode.
for the last line of above code
Dim response As WebResponse = request.GetResponse()
This line of code means I get the authentication response from pentaho server then assign to variable response
In running, I found that Pentaho can return authentication result and put it to variable response.It seem okay that the authentication is passed and I login successfully
but when I input a link http://x.x.x.x:8080/pentaho/Home in browser, the login page still prompt and I need to login again....
pentahologin.png
Do you know what code I missing so that the Pentaho cannot login auto after above code complete? Thanks you much!!!!!
My .NET code is:
Dim request = WebRequest.Create("http://x.x.x.x:8080/pentaho/Home")
Dim authInfo As String = Convert.ToString(userName) & ":" & Convert.ToString(userPassword)authInfo = Convert.ToBase64String(Encoding.[Default].GetBytes(authInfo))
request.Headers("Authorization") = "Basic " & authInfo
Dim response As WebResponse = request.GetResponse()
You can see that I pass the authorization header with Basic username: password with Base64 encode.
for the last line of above code
Dim response As WebResponse = request.GetResponse()
This line of code means I get the authentication response from pentaho server then assign to variable response
In running, I found that Pentaho can return authentication result and put it to variable response.It seem okay that the authentication is passed and I login successfully
but when I input a link http://x.x.x.x:8080/pentaho/Home in browser, the login page still prompt and I need to login again....
pentahologin.png
Do you know what code I missing so that the Pentaho cannot login auto after above code complete? Thanks you much!!!!!