Announcement

Migration of this forum

Dear users of this forum,

we are pleased to inform you that we will be updating the software behind this forum in the near future.

Existing posts, users and categories will remain untouched.

Important:

  • Each user will need to reset their password.
  • Please select "I forgot my password".
  • Enter the email address you used to register in this forum.
  • You will receive an email with a link to set a new password.
  • Please choose a new (secure) password and confirm the process.

We will keep you informed in the pinned thread.

Kind regards,
Your ReportServer Team


Migration des Forums

Liebe Nutzer dieses Forums,

wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.

Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!

Wichtig:

  • Jeder Nutzer muss sein Passwort neu vergeben.
  • Wählt dazu einfach "Ich habe mein Passwort vergessen".
  • Gebt die E-Mail-Adresse ein, mit der ihr registriert seid.
  • Ihr erhaltet eine E-Mail mit einem Link zur Passwortvergabe.
  • Bitte wählt ein neues (sicheres) Passwort und bestätigt den Vorgang.

Wir halten euch im angepinnten Beitrag auf dem Laufenden!

Mit vielen Grüßen
Euer ReportServer Team

#1 2017-08-29 06:30:54

sateesh.nvl
Member
Registered: 2017-08-29

Unable to access URL parameters in a custom PAM script

Hi,
I am trying to set up an SSO integration and attempted with a very simple script to test it out.  However, the following script does not seem to read parameters passed in URL.

The URL I am using to access report server is this:  http://localhost:8080/?ssouser=root

Please note that the script works fine if I directly pass the username as string
The code in my script is this:

import net.datenwerke.security.service.authenticator.ReportServerPAM;
import net.datenwerke.rs.authenticator.client.login.dto.UserPasswordAuthToken;
import net.datenwerke.security.service.authenticator.AuthenticationResult;
import net.datenwerke.security.service.usermanager.UserManagerService;
import net.datenwerke.security.service.authenticator.hooks.PAMHook;
import net.datenwerke.security.service.authenticator.hooks.adapter.PAMHookAdapter;
import javax.servlet.http.HttpServletRequest;


def userService = GLOBALS.getInstance(UserManagerService.class);

def requestProvider = GLOBALS.getProvider(HttpServletRequest.class);
HttpServletRequest req = requestProvider.get();
def ssouser = req.getParameter('ssouser');

/* the below line works, but not the above dynamic variable */
/* def ssouser = "root" */

def customPAM = [
  authenticate : { tokens ->
    return new AuthenticationResult(true, userService.getUserByName(ssouser)); // login the root
  },
  getClientModuleName : { return "net.datenwerke.rs.authenticator.client.login.pam.UserPasswordClientPAM"; }
] as ReportServerPAM;

def callback = [
  afterStaticPamConfig : {pams ->
    pams.clear();
    pams.add(customPAM);
  }
] as PAMHookAdapter;

GLOBALS.services.callbackRegistry.attachHook("MY_CUSTOM_AUTHENTICATOR", PAMHook.class, callback);

Any help is greatly appreciated. Thanks

Offline

#2 2017-09-03 15:46:20

IF_Eduardo
Administrator
Registered: 2016-11-01
Website

Re: Unable to access URL parameters in a custom PAM script

Hi sateesh.nvl,

I'm afraid url parameters are not available with PAM scripts, as explained here: https://forum.reportserver.net/viewtopic.php?id=297, #7.
Could you use an approach similar as the one stated in #7 ? It should work using redirection.

Best regards,
Eduardo

Offline

Board footer

Powered by FluxBB