Skip to content

Instantly share code, notes, and snippets.

@jbenninghoff
Last active April 3, 2020 22:53
Show Gist options
  • Select an option

  • Save jbenninghoff/75a02c446f630dfb16886c9a5491fc4e to your computer and use it in GitHub Desktop.

Select an option

Save jbenninghoff/75a02c446f630dfb16886c9a5491fc4e to your computer and use it in GitHub Desktop.
Hue SAML configuration on EMR

To enable HUE to use SAML authentication, the Service Provider (Hue) and the Identity Provider (samltest.id) must exchange meta-data to accept each others identity. The procedure to do that on the EMR master node is outlined below.

  1. Hue is the Service Provider and http://samltest.id is the Identity Provider in this example
  2. Install the tools to enable Hue to handle SAML:
    1. yum install git gcc python-devel swig openssl
    2. yum install --enablerepo=epel xmlsec1 xmlsec1-openssl
  3. Acquire the IDP metadata from http://samltest.id and save into samltest.xml file
  4. Put the xml file in /etc/hue/conf/security/samltest.xml
  5. Verify key and cert files exist.
  6. Create dummy key and cert files if they do not exist.
    1. openssl genrsa -des3 -out dummy.key 2048
    2. openssl rsa -inform PEM -outform PEM -in dummy.key -pubout -out dummy-nopass.pem
  7. Modify hue.ini with the following
## Example hue.ini settings
[desktop]
redirect_whitelist="^\/.*$,^http:\/\/samltest.id:8080\/.*$"
[[auth]]
backend=libsaml.backend.SAML2Backend
[libsaml]
xmlsec_binary=/usr/bin/xmlsec1
metadata_file=/etc/hue/conf/security/samltest.xml
key_file=/etc/hue/conf/security/key.pem
cert_file=/etc/hue/conf/security/cert.pem
username_source=nameid
name_id_format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
entity_id=samltest.id
logout_enabled=false
  1. Restart Hue:
    1. sudo stop hue
    2. sudo start hue
  2. Acquire the Hue (SP) metadata:
    1. curl -k -LO https://masternode:8888/saml2/metadata
  3. Upload Hue metadata to http://samltest.id/
  4. Test Hue login at https://masternode:8888/ with account from samltest.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment