Giter Club home page Giter Club logo

onelogin-oidc-node's Introduction

OneLogin OpenId Connect Node Samples

This repo contains Node.js sample apps that demonstrate the various OpenId Connect flows

  1. Auth Flow - An Express + Passport app example
  2. Implicit Flow - A Single Page App (SPA) example
  3. Password Grant - A sample using the Resource Owner Password Grant
  4. Auth Flow + PKCE - Best practice for SPA or native mobile apps

What can I use these for

OpenId Connect is a great way to add user authentication to your application where you are depending on another party to manage the user identities.

In this case OneLogin can manage the identity of your users making it faster to get up and running.

Single Sign On (SSO)

By implementing OpenId Connect via OneLogin you are creating a OneLogin session which can be used to single sign on from your custom app into other apps that your users may have access to via the OneLogin portal

MFA

If MFA is enabled for a user in OneLogin then they will be prompted to enter a token during the authentication. OneLogin takes care of all of this for you, making strong authentication much easier to implement in your app.

Requirements

In order to run any of the samples you will need to create an OpenId Connect app in your OneLogin Admin portal. You can read more about how to do that here.

If you don't have a OneLogin developer account you can sign up here.

Local testing

By default these samples will run on http://localhost:3000.

You will need to add your callback url to the list of approved Redirect URIs for your OneLogin OIDC app via the Admin portal. e.g. http://localhost:3000/oauth/callback

US and EU instances

Examples use as base URL for OIDC endpoints: https://openid-connect.onelogin.com/oidc. If you are using an EU instance, use instead the value https://openid-connect-eu.onelogin.com/oidc.

onelogin-oidc-node's People

Contributors

hel5sou avatar isalew avatar pitbulk avatar richet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onelogin-oidc-node's Issues

iat is in the future 1536067127

I cannot seem to get the SPA example working.
Every time I try to authenticate I keep getting the error:

iat is in the future 1536067127

Can this be related to a config issue or rather system date & time?

Can't connect to site locally

Hey there,

Trying to run this app locally to test it out. I keep getting 404s. There's a weird "undefined" in the URL after clicking login, I'm not sure where that's coming from. My OIDC_REDIRECT_URI from the .env file matches the Redirect URI in my OIDC panel configs (http://localhost:3000/oauth/callback). My token endpoint method is set to POST. Not sure what the next step here would be. Thanks!

image

How to implement silent renew with one login ?

I don't see this example implementing silent renew so I'm wondering how we can do it with one login. I tried to implement it in my react app but I just got this End User Authentication required error when I turned on automaticSilentRenew (it triggered signinSilent from the oidc-client lib when the token is about to expire). It seems to me that one login could not recognize the id_token_hint in the request param that is sent from the silent renew call by the lib. Thus, it doesn't recognize that the user has an active session with one login while receiving the silent renew request from the client. How can we solve this problem ? Thanks !

[Question] Onelogin Logout (SLO) via oidc javascript client

Hi,
I want to use Onelogin as the IDP for 2 different SPA's (angular apps), so I cloned this repo in order to test different scenarios.

I was able to setup the OIDC Connector in my Onelogin Account and was able to login different Users.

Next I wanted to try to log a User out of "App - A" and recognize it in "App - B". Therefore I started with the Logout itself, leading me to this error: No end session endpoint url returned while calling the signoutRedirect Method of the Oidc.UserManager

I know that you can override specific metadata for the UserManagerSettings, so I gave the metadata from onelogin oidc a look. (<your_endpoint>/oidc/.well-known/openid-configuration)
There is not a single metadata endpoint which would be close to one that sounds like it would log out a User from all sessions.

Is this not supported by Onelogin or how can this be achieved ?

password grant type is not working for me

I tried Password grant type, but it again & again asking username & password, does not navigate to any
ang getting
GET / 304 80.462 ms - -
GET /stylesheets/style.css 304 1.199 ms - -
POST /login 302 312.710 ms - 46
GET / 304 4.022 ms - -
GET /stylesheets/style.css 304 0.338 ms - -
POST /login 302 33.700 ms - 46
GET / 304 3.406 ms - -
GET /stylesheets/style.css 304 0.528 ms - -

onelogin "Halogen Software" App Store needs to be updated

As you may be aware, Halogen Software has recently been acquired by Saba Software.
https://www.saba.com/press/news/saba-software-announces-agreement-to-acquire-halogen-software
Thus, the "Halogen Software" TalentSpace Product is currently called "Saba TalentSpace".
 
Could you update your public documentation:
  https://www.onelogin.com/connector/halogen
  https://www.onelogin.com/connector/halogenadmin
 
It is using the old Saba logo. You can see what Saba Software current logo looks like from the above article or by just visiting saba.com

    You can get the logo from here:
    https://archive.org/download/sabalogo/sabalogo.png

Also, maybe the URLs could be updated (e.g. - https://www.onelogin.com/connector/talentspace) ?
 
  
Secondly, the following are screenshots of your onelogin App Store when searching for "Halogen":
  https://archive.org/download/app_store2/app_store2.jpg
  https://archive.org/download/app_store/app_store.jpg
 
We are having to tell our clients to search for "Halogen Software" to implement SSO. It would be great if you could update these to say "Saba TalentSpace" and with the current logo.
 
For the built-in "Rectangular Icon", you can use:
  https://archive.org/download/sabafulllogo/sabafulllogo.png
 
For the built-in "Square Icon", you can use:
  https://archive.org/download/sabalogo/sabalogo.png
 
 
Lastly, for the "Configuration" section of the SAML SSO app you have for Halogen Software, the built-in app appears to only come with a "SAML Audience URL" field and a "SAML Consumer URL" field which will fail when configuring this with clients.
 
It should come with the "SAML Consumer URL", "SAML Audience URL", "SAML Recipient", and "ACS URL Validator".
 
Otherwise, we're forced to walk clients through adding a custom app via "SAML Test Connector (IdP w/ attr") which comes with all these fields to get this working successfully.

Can't switch user after forcing a login with prompt=login

I read that OneLogin OIDC Provider does not currently support single logout, although I managed to "force" a login from my React app with prompt: "login" setting.

However, when I am redirected to the login screen & I try to use a different user's credentials, I receive 500 Internal Server Error. Until I either

  • explicitly go to the OneLogin portal and sign out the last logged-in user,
  • use my app in the incognito mode,

it seems impossible to "switch" accounts in my app.

Is there any workaround for that?

Authorization Flow not working?

I'm trying to walk through this tutorial but the application is not going to the login screen once the login button is clicked. I am seeing this in my console:

GET /?code=YmMyZTJlY2MtNjIwYi00Zjc0LTljMjEtZTI4MTI5OTJkODY54_Dumh8dkTJcpNQoV7ClooOYXEE8c-YYR694nfl_hi5CSZ4mW7-DITNnpJcMf05TLMr65nebyY--JQTTE05-gg&state=loUWE64wD%2FzZxYKwG4B%2BrQj3 200 3.322 ms - 540

which tells me the request is being made succesfully but the login screen never appears for me to actually login and there is not 'flow' to follow or understand this process.

I have set up an app in the compants apps and changed the .env.sample to .env along with updating the variables within the .env file

Implicit Flow not working?

I'm going through the tutorial and found a few issues:

  1. Clone this repo and then update /javascripts/main.js with the client_id you obtained from OneLogin and the subdomain of your OneLogin account.

There seems (on my end) to be an issue with the client_id and subdomain instructions. It's not entirely obvious if the client_id needs to be the one that is issued in the OneLogin App or our personal API one given to us. If it's the later, that will throw an error with the following output:

error: invalid_client
error_description: client is invalid
state: 7f38287367a6475f9eaa6c0b6370c1c

When I have the correct client_id setup in the javascripts/main.js file I am not seeing anywhere there being a field for me to specify the parameter of subdomain. Can someone tell me where this is supposed to be specified as I don't see it being a valid parameter per the codes layout ATM?

  1. You will need to add your callback url to the list of approved Redirect URIs for your OneLogin OIDC app via the Admin portal. e.g. http://localhost:3000/oauth/callback

So I have http://localhost:3000/oauth/callback setup in the configuration --> redirect URI's field and it still is throwing me an issue:

error: redirect_uri_mismatch
error_description: redirect_uri did not match any client's registered redirect_uris
state: 497592e85aae4273ad05f397fbd6dcc9

Can I get a hand clarifying what's going wrong? I'd be more than happy to update the docs in return for a hand in this :)

Npm install warning - 4 Vulnerabilities (1 moderate, 3 high)

When installing your example onelogin-oidc-node application. npm install returns the following error/ warning.

added 137 packages from 146 contributors and audited 339 packages in 1.6s
found 4 vulnerabilities (1 moderate, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details

This comes down to one dependency in package.json.

-    "hbs": "^4.0.5",
+    "hbs": "^4.1.0",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.