Skip to content

Unable to get user profile information from CILogon #125

@minump

Description

@minump

Unable to get user profile information like first name, last name, email , organization/ instittution from the OAuth2Strategy CILogon implementation here. .
Below is the log of the CILogon response for this code

fetch('https://cilogon.org/oauth2/userinfo?access_token=' + accessToken)
		.then(function (response) {
			console.log("CILogon response", response);
			return response.json();
		})
		.then(function (json) {
			process.nextTick(() => cb(null, json));
		})

The log is below:

CILogon response Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _events: [Object],
      _readableState: [ReadableState],
      _writableState: [WritableState],
      allowHalfOpen: true,
      _maxListeners: undefined,
      _eventsCount: 5,
      [Symbol(shapeMode)]: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://cilogon.org/oauth2/userinfo?access_token=<access_token>',
    status: 200,
    statusText: 'OK',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }

However, directly logging in to CILogon from browser, you are able to get all these information. See screenshot below.

This user information is required to update the "users" table in postgresDB. The user email can be used as the unique identifier. Currently the implementation uses username as unique identifier, which is not ideal.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions