Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @

Connecting Science Gateway/Applications hosting framework with the User Registration Portal (URP)

From EGIWiki
Revision as of 10:47, 1 August 2017 by Larocca (talk | contribs)
Jump to navigation Jump to search
Applications on Demand Service menu: Home Documentation for providers Documentation for developers Architecture


This wiki page contains a short overview of the integration steps that Science Gateway/Applications hosting frameworks must complete to contribute to the EGI Applications on Demand (AoD) service.

The User Registration Portal (URP) provides the identity federation mechanism that enables users to authenticate in any of the connected Science Gateways/Applications hosting frameworks with either social credentials or the EGI SSO accounts.

In this old implementation, this identity federation is implemented with Unity [1], an authentication & authorization management solution that uses OpenID Connect as standard interface.

Alert.png This article is Deprecated and should no longer be used, but is still available for reasons of reference.

Connecting the Science Gateway with the URP

Client service Registration

1. Open the GGUS ticket to operations that include return URIs

2. UNITY team send Client clientID and secretKey

Authorization procedure Unity with Client:

1] The Client sends a request to the OpenID Provider

redirect_uri: [[Redirect url]]
client_id:unity-oauth-egrantstate: [[You should generate your own state eg. md5(uniqid(rand(), TRUE));]]

scope:profile openid 


response_type=code &client_id=123123123 & &scope=openid%20profile


2] Authorization Server authenticates the End-User.
3] Authorization Server obtains End-User Consent/Authorization.
4] Authorization Server sends the End-User back to the redirect uri from the first request (Redirect url) with code.

example of the response

Location: []

code=uniquecode123 &state=a123a123a123

5] Client sends the code to the Token Endpoint to receive an Access Token and ID Token in the response.

POST /token HTTP/1.1

Host: []

Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

Content-Type: application/x-www-form-urlencoded



6] Client validates the tokens and retrieves the End-User's Subject Identifier.

HTTP/1.1 200 OK

Content-Type: application/json

Cache-Control: no-store

Pragma: no-cache








You should decode id_token and make some validation (more information:

7] Client Gets some information from userpoint endpoint (


8] User gets information about user such as email or name in json format

important data:

unity.server.clientId=  [YOUR CLIENT ID]
unity.server.clientSecret= [YOUR SECRET KEY]




full configuration:

List of attributes released by Unity

for scope 'profile':

  • name (string)
  • email (string)
  • confirmedRegistration (true/false) - tells if user has confirmed affiliation request
  • hasActiveSla - (true/false) - tells if user has confirmed resource request

both confirmedRegistration and hasActiveSla have to be set to 'true' to accept user as full member

for scope 'additional':

  • persistent (string) - persistent ID of user given by UNITY. Attribute should be used by SG providers as a source of unique userID.

OpenID Connect for Liferay

OpenId Connect for Liferay is a very rough but effective implementation of the OpenId connect protocol for Liferay. Use this module to authenticate with any OpenId Connect provider.

OpenID Connect for Django

To configure Django project to support OpenID Authentication it is possible to use the django-oidc-auth module.

How to use
$ pip install django-oidc-auth

Then configure the module:

INSTALLED_APPS += ['oidc_auth']


        'issuer': '',
        'client_id': AUTH_OIDC_CLIENT_ID,
        'client_secret': AUTH_OIDC_SECRET,
    'SCOPES': ['openid', 'profile'],

Finally, add this to your

urlpatterns = patterns('your.views',
    # ...
    url(r'oidc/', include('oidc_auth.urls')),


python migrate