Jump to content

External Authethentication: Getting Parameters outside of the "Init" method.


Kevin Flynn

Recommended Posts

IGNORE THE BELOW: USER ERROR (Had to put in an "If" statement to check them for null.

I had to put an if statement around them to check for nulls.

Current Version (10.3.9 can change to 10.9 if needed).

Main Auth: Custom JAAS:

Secondary: External Auth:

I am running Spotfire inside a different software, the users authenticate in that software with the software's login Screen.

Different analysis will have buttons on a bar, once they click the bar it will display the analysis in an iframe.

When calling Spotfire Web it will send a AuthID in the query (&AuthId=123423sfw3242323);

(I have some other security measures ie encrypted username in a cookie but it seems to be working)

Is there a way to call for parameters without having the Init Method I have found an issue where if you have the below code it will not work in the Analyst or at the regular web login screen:

@Override

 

public void init(CustomAuthenticatorInitContext initContext) {

parameters = initContext.getParameters();

username = parameters.get(dbusername);

password = parameters.get(dbpassword);

connectionstring = parameters.get(dbconnectionstring);

}

 

I have tested a few times and commenting out the above code will allow it to log into all 3 (inside the Application, Analysis, and the regular web login screen).. Is there a way to get the parameters at runtime in a different method Have tried a few times and they always return null or give a null pointer exception.

Link to comment
Share on other sites

I have answered the quesiton myself by breaking it myself.

Below is the code that I had to do (didn't have the If statement to check if Parameters was null.

Hopefully my hours spent will save someone else a lot of time.

@Override

public void init(CustomAuthenticatorInitContext initContext)

throws CustomAuthenticatorException {

parameters = initContext.getParameters();

if(parameters!=null) {

username = parameters.get(dbusername);

password = parameters.get(dbpassword);

connectionstring = parameters.get(dbconnectionstring);

//System.out.println("UserName="+username + " Password="+ password + " ConnectionString=" + connectionstring) ;

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...