Solved

FME Server email read from fme user

  • 26 February 2019
  • 3 replies
  • 9 views

Badge

I use FME Server 2018. I'd like to send the result of a job to the user that submitted the job. I'd like to retrieve the email from the users list inside fme server because there are synchronized with Active Directory. With the FME_SECURITY_USER I've got the user but there aren't others FME_SERVER variables that contains the email. How I can get this information?

 

Thank you for suggestions.

icon

Best answer by david_r 26 February 2019, 13:32

View original

3 replies

Userlevel 4

I suspect the only option is to use the REST API to retrieve the user properties based on FME_SECURITY_USER:

GET /security/accounts/$(FME_SECURITY_USER)

Response:

account {
  email (string, optional): Email of the account,
  enabled (boolean): Whether the account is currently enabled or not,
  fullName (string): Full name of the account,
  name (string): Unique name of the account,
  password (string): Account password,
  roles (array[string], optional): Roles assigned to the account,
  type (string) = ['System' or 'Ldap']: Type of the account
}

You can use the FME_SERVER_HOST + FME_SERVER_PORT as a basis for the query URL.

Badge

I suspect the only option is to use the REST API to retrieve the user properties based on FME_SECURITY_USER:

GET /security/accounts/$(FME_SECURITY_USER)

Response:

account {
  email (string, optional): Email of the account,
  enabled (boolean): Whether the account is currently enabled or not,
  fullName (string): Full name of the account,
  name (string): Unique name of the account,
  password (string): Account password,
  roles (array[string], optional): Roles assigned to the account,
  type (string) = ['System' or 'Ldap']: Type of the account
}

You can use the FME_SERVER_HOST + FME_SERVER_PORT as a basis for the query URL.

Hi @david_r , thank you for your suggestion. Is a good idea. Yesterday I've cheked the other way to querying the useraccount table in fmeserver db and get the mail from it and works. I will to switch to api to have more flexibility in the future.

I open an Idea to create a new variables like FME_SECURITY_USER but f.e. FME_SECURITY_USER_EMAIL with the email automagically set by fme.

Thank you

Userlevel 4

Hi @david_r , thank you for your suggestion. Is a good idea. Yesterday I've cheked the other way to querying the useraccount table in fmeserver db and get the mail from it and works. I will to switch to api to have more flexibility in the future.

I open an Idea to create a new variables like FME_SECURITY_USER but f.e. FME_SECURITY_USER_EMAIL with the email automagically set by fme.

Thank you

That's a nice workaround, but since you're using an undocumented function be sure to specifically re-test this every time you upgrade FME Server.

I voted for your idea, it's a good one.

Reply