Module: NorthwesternSSO

Methods

(async, static) getLoginUrl(isDuoRequired, redirectUrl, apigeeEnv, apigeeApiKey) → {String}

Get the url for redirect to websso login
Parameters:
Name Type Description
isDuoRequired Boolean Whether to generate a url for login-only or login+duo
redirectUrl String the url to redirect to once login is successfully completed
apigeeEnv String The apigee environnment to call (dev, test, prod)
apigeeApiKey String the application's api key
Source:
Returns:
A websso login url
Type
String

(async, static) getLogoutUrl(apigeeEnv, apigeeApiKey) → {String}

Get the url for redirect to websso logout
Parameters:
Name Type Description
apigeeEnv String The apigee environnment to call (dev, test, prod)
apigeeApiKey String the application's api key
Source:
Returns:
A websso logout url
Type
String

(static) getNetID(sessionInfo) → {String}

Get the user's netid
Parameters:
Name Type Description
sessionInfo sessionInfoResponse The response from the session info service (status, body)
Source:
Returns:
the logged in user's netid if it exists in the session info (null otherwise)
Type
String

(async, static) getSessionInfo(tokenId, apigeeEnv, apigeeApiKey) → {sessionInfoResponse}

Calls websso url to get information about the session for a given sso token
Parameters:
Name Type Description
tokenId String The value in the sso cookie
apigeeEnv String The apigee environnment to call (dev, test, prod)
apigeeApiKey String The application's apigee apikey
Source:
Returns:
Returns an object with the sessionInfo request status and request body
Type
sessionInfoResponse

(static) getSSOCookie(requestCookies) → {String}

Parses json object of all cookies and returns the sso cookie value
Parameters:
Name Type Description
requestCookies Object A JSON object of all request cookies to check
Source:
Returns:
The SSO request cookie value
Type
String

(static) isDuoAuthenticated(sessionInfo) → {Boolean}

Checks whether the user passed through DUO
Parameters:
Name Type Description
sessionInfo sessionInfoResponse The response from the session info service (status, body)
Source:
Returns:
True if user has a valid session (200 + netid) and passed through DUO. False if session is invalid or did not pass through DUO.
Type
Boolean

(static) isLoggedIn(sessionInfo) → {Boolean}

Checks whether the user's session is valid
Parameters:
Name Type Description
sessionInfo sessionInfoResponse The response from the session info service (status, body)
Source:
Returns:
True if status is 200 and a netid value is found in the sessionInfo. False if status is 401 Unauthorized, or other.
Type
Boolean

Type Definitions

sessionInfoResponse

Type:
  • Object
Properties:
Name Type Description
status String The response code of the request
data Object The response body of the request
Source: