Skip to main content

Dear everyone, In my fme workflow I have some published parameters and one of them is email (

opt_requesteremail) . For data download option I used this email parameter to get the data download link in email address. Till yet I am putting email address by my own. But I want to get email address automatically from user login. We are using LDAP.

Thanks

Regards

Muqit Zoarder

If you are deploying this on FME Server then you can get the username using the parameter $FME_SECURITY_USER I believe.

I don't know if we have a Desktop parameter or env variable for the currently logged in username, but I did find that I could obtain it using Python:

import fme
import fmeobjects
import getpass
# Template Function interface:
def processFeature(feature):
    feature.setAttribute("MyUsername",getpass.getuser())
    pass

So once I get my username I could tag @safe.com on the end to give me my email address.

I hope this is what you were looking for.


If you are deploying this on FME Server then you can get the username using the parameter $FME_SECURITY_USER I believe.

I don't know if we have a Desktop parameter or env variable for the currently logged in username, but I did find that I could obtain it using Python:

import fme
import fmeobjects
import getpass
# Template Function interface:
def processFeature(feature):
    feature.setAttribute("MyUsername",getpass.getuser())
    pass

So once I get my username I could tag @safe.com on the end to give me my email address.

I hope this is what you were looking for.

Hi Mark, thanks for your response, I am using fme server as well, but $FME_SECURITY_USER is it for only user name extarction or email? Because I need email.

 

 


If you are deploying this on FME Server then you can get the username using the parameter $FME_SECURITY_USER I believe.

I don't know if we have a Desktop parameter or env variable for the currently logged in username, but I did find that I could obtain it using Python:

import fme
import fmeobjects
import getpass
# Template Function interface:
def processFeature(feature):
    feature.setAttribute("MyUsername",getpass.getuser())
    pass

So once I get my username I could tag @safe.com on the end to give me my email address.

I hope this is what you were looking for.

Yes. i can accept your answer partially, because in our LDAP all the user does not has same email domain of our Institute. Emails are different, so somehow we have to extract the email from user login ID. 

 

 


Yes. i can accept your answer partially, because in our LDAP all the user does not has same email domain of our Institute. Emails are different, so somehow we have to extract the email from user login ID.

 

 

Ah, LDAP! Of course... in FME 2018 or newer there is an LDAP reader. You should be able to read information from there, and hopefully it will include what you need. So give that a try and let us know how it goes.

 

I should mention that the documentation says that this format is a "technology preview" - i.e. it's still in beta for all intents and purposes.

 


If you are deploying this on FME Server then you can get the username using the parameter $FME_SECURITY_USER I believe.

I don't know if we have a Desktop parameter or env variable for the currently logged in username, but I did find that I could obtain it using Python:

import fme
import fmeobjects
import getpass
# Template Function interface:
def processFeature(feature):
    feature.setAttribute("MyUsername",getpass.getuser())
    pass

So once I get my username I could tag @safe.com on the end to give me my email address.

I hope this is what you were looking for.

We are using 2017, and we have to strict on it, so is there any other possibilities?

 

 


We are using 2017, and we have to strict on it, so is there any other possibilities?

 

 

There's a JDBC format reader. If you can find a driver then you could use that reader to access the data I think. I suspect the LDAP reader is just the JDBC reader with that driver built-in. So I think it's possible, just a bit more work.

 

 


Reply