Does OneLogin support client session management via OIDC? - javascript

I've setup an OIDC Connect App inside my OneLogin account and was already able to login different users using this client
https://github.com/IdentityModel/oidc-client-js
and the "implicit flow".
The oidc-client-js supports session management out of the box using the iFrame mechanic to poll the IDP (onelogin in my case) about the status of the users session.
https://brockallen.com/2016/08/12/check-session-support-in-oidc-client-js/
The OIDC client does not even start doing so since in my signin return data there is no "session_state" value, instead it is just undefined.
I was reading the OIDC specs about it
https://openid.net/specs/openid-connect-session-1_0.html
and from paragraph 2-5 there are all the things the IDP needs to offer in order to make session management work via OIDC.
Since I could not find anything in the OneLogin Docs, I would appreciate any hint, help, experiences with this specific

https://openid.net/specs/openid-connect-session-1_0.html:
2.1. OpenID Provider Discovery Metadata
These OpenID Provider Metadata parameters MUST be included in the
Server's discovery responses when Session Management and Discovery are
supported:
check_session_iframe ...
end_session_endpoint ...
I don't see these metadata parameters in the OneLogin discovery metadata, so it looks like Session Management is not supported.

I'm the product manager for OpenId Connect at OneLogin. The accepted answer is correct. We don't currently support the session management spec but are considering it as a future roadmap item.

Related

How to limit authentication/sign-up request to custom email domains with Firebase Authentication

Is there a way to limit use of a web app to only users who have access to a specific custom Gmail domain. e.g users must have a '#companyName.ac.uk'email address in order to successfully sign-up/create an account.
Using just Firebase Authentication, no, you can’t limit who authenticates-it just authenticates users. Controlling what kind of privileges various users are granted is an issue of authorization and that’s up to the developer to build. That being said, Firebase does offer some features that can help like auth token custom claims, server-side Functions, and Firestore/Real-time Database access rules. Which combination of these works best for you depends on how you’re building you app.

How to use SSo with firebase authentication for web?

I am trying to implement sso with firebase authentication and i am trying to use without using third party like okta and wanted to know is it any workaround with this.basically the use case like this
A client wanted to build a custom SSO solution and had already chosen Firebase, based on Google’s promise to rollout SSO support in the future. The client did not want migration to any other SSO provider like Auth0 or Identity Server, or to deal with user-password migration and potential related issues. They preferred instead to use a temporary, custom solution that would store user’s passwords in Firebase Authentication.
The client had several customer portals based on WordPress Customer Relationship Management (CRM) and an existing list of users in Firebase Authentication. Each time users visited a new portal, credentials were required, and again when users followed a link from one portal to another. It was not always obvious for users that the same credentials should be used for different portals.
By default, Firebase keeps authentication context for one domain but doesn’t provide seamless SSO integration between different domains. To provide this functionality, SoftServe determined that a new Firebase service should be implemented.

How to 'remember' a user when he logged in -passport.js-phonegap

So I have a Node.js server based on the Sails.js framework and I have successfuly implemented passport.js in a way that:
(login)POST /auth/local: if validated returns ID,Username and Email address.
(register)POST /auth/local/register: when registered returns ID,Protocol,Hashed password, UserID and an accessToken.
Now in my phonegap(ionic framework) I need to keep some data to make a login request automaticly everytime the user opens the app. I used to save the passport and the username localy but I understood that its a very series security hole.
Should I use a more secure localStorage? Should I use at all? Should I just save the userID? please clear this issue to me.
First of all if you're not aware you should read oatuh 2.0 protocol documentation. But I'm warning you that it can be quite complex and how you implement it, it's up to you.
This is package for PHP but in it's wiki it sums pretty well the four types of grant that you can achieve with oauth:
Authorisation code grant
Implicit grant
Resource owner credentials grant
Client credentials grant
In your case I think that Resource Owner Password Credentials Grant is enough, but then again that it's up to you.
I have found this two npm packages, that maybe can help you out node-oauth20-provider and Sails-OAuth2-API

Firebase in Cordova/Phonegap: Log in using Email/Password from within app?

I'm running a webview from a cordova app and want to authenticate a user, I know they have the OAuth strategies but I need to use the email/password combination.
I'd like to keep things simple but may end up having to generate a token.
Open an InAppBrowser that loads an auth flow for firebase
Listen for that auth flow to be completed using this method: http://blogs.telerik.com/appbuilder/posts/13-12-23/cross-window-communication-with-cordova%27s-inappbrowser
Grab the result from the webview again and insert it into the webview firebase instance
I'm guessing that's not possible due to security.
My app is using Amazon login (required) so my alternative would be:
webview loads InAppBrowser with our external url
that loads Amazon auth, then generates a token for Firebase
webview listens for token and grabs it, stores it in localstorage
Edit:
In the firebase docs on logging in with a username/password, I see it returns a token for the session and more information in the authData object:
https://www.firebase.com/docs/web/guide/user-auth.html
Could I then take all the information from that object and send it back over to the cordova webview and then populate that Firebase ref with the information?
Some answers from the wonderfully helpful support at Firebase:
First:
You’re correct – anyone can make a request to sign up, and we don’t expose any capability to secure the url which people can sign up from for email / password authentication.
The main reason that we require / enable origin whitelisting for OAuth authentication, but not for email / password authentication, tends to revolve around sessioning.
The Firebase login server does not maintain sessions (via cookies or any other method), and so requests to the login server for password auth. requires a user credential (the password) for every request. CSRF is typically a risk when a malicious party can take advantage of a user’s session browser, i.e. make requests on behalf of the user to some page where cookies are automatically sent by the browser.
Furthermore, we don’t have a great way to actually do ideal origin-based whitelisting for these pure HTTP requests. We could use CORS, but would have to fall back to JSONP for older browser environments that don’t support it. To complicate matters further, PhoneGap / Cordova apps don’t have the same notion of an “origin” at all, and from the perspective of a server – the calls are indistinguishable from any malicious party making an HTTP request with the same headers.
The OAuth providers, however, use cookies for sessioning and do not require user invention for each auth. request. If you’ve approved a particular Facebook app, you won’t be shown any UI/UX or be prompted the next time that app requests your data – it will be invisible. When we do OAuth, we never have to send any user credentials to Facebook / Twitter / etc., because those are stored in browser cookies for facebook.com / twitter.com / etc. What we need to protect is a malicious party pretending to be a popular, valid Facebook app. and taking advantage of that short-circuit behavior that would get access to user data without the user’s knowledge.
My response:
So, how is that secured? If anyone can make a request to sign up from a
cordova webview (which comes from no specific url, just the app iteself)
then I can't secure from which url people can sign up from? So any site
could use our url "xxx.com" in their config and start registering
users?
That doesn't seem right to me.
I think I still need to have an external url that is whitelisted by you
guys. That would have the login form and do the auth.
But then my question is, can I transfer that auth back to my cordova app?
Is it somewhere in localStorage I can check? I'll have to run some tests.
And final response:
Sure thing – we’re happy to help. I wrote much of the original client authentication code, and can speak to the design decisions and rationale that went into it. Be sure to let me know if you have further questions there.
While we don’t store user passwords in cookies, of course, we maintain a Firebase auth. token in LocalStorage. Our authentication tokens are signed by your unique Firebase secret (so they cannot be spoofed), and can contain any arbitrary user data that would be useful in your security rules.
By default, and when using the delegated login (email + password) service, these tokens will only contain a user id to uniquely identify your users for use in your security rules. For example, you could restrict all writes or reads to a given path (e.g. write to /users/$uid/name) by the user id present in the token (“.write” = “$uid = auth.uid”). Much more information on that topic available on our website.
Your plan to spin up a server to authenticate users with Amazon and generate tokens sounds correct. This is a common pattern for our users who wish to use authentication methods that we don’t support out-of-the-box (ie Amazon OAuth) or have custom auth requirements. Note: once you’ve created those tokens and sent them down to the client, they’ll be automatically persisted for you once you call ref.authWithCustomToken(…). Subsequent restarts of the app will use the same token, as long as it has not yet expired.
This is a topic of interest to me too as I have implemented something similar , twitter digits (native android) + firebase custom login in webview.
I think, as recommended by firebase, you can use other authentication providers and then the firebase custom login.
Do you use the Amazon login in android native code ? If so after login, then generate a JWT token for firebase and use it to access firebase.
If all code is in Html/js app, then maybe you can use custom login and generate a token on your server after making sure its logged in to the Amazon.
The trouble with Android hybrid apps is the following: the JWT token (for firebase) should be created on secure system (eg. server side) not with android java code, other option for hybrid app is to do a http request to generate the token, but I find that less secure, anyone would be able to get a token by finding the URL, than I resort to generate token within android app code, you can change security key/seed for token when doing new releases.
In summary, I don't think firebase studied the problem of mobile hybrid apps.

What is OAuth authentication?

I am developing an iGoogle Gadget. I have to access the spreadsheet data of logged in user. How do I implement an OAuth for it?
You have to become an OAuth Consumer of the Google services - they are the OAuth provider in your case.
There are a lot of open source implementations of the protocol in various languages, but I would suggest to read through the RFC if you want to implement it - it's clearly written and not very long.
The official site has good reads and links too:
http://oauth.net/
Basically it's a protocol that exchanges a little bit of data between you (your application aka the consumer), the provider and your user with internal HTTP requests between you and the provider (exchanging tokens) and some redirects through the user's browser between you and the provider again.
Also, you as a consumer will have to store some tokens and data regarding these interactions. It's not very complicated and in the same time is very interesting thing to implement. I learned things about security, request signing, some http details and headers. And if you already know these things, then you will do it a lot faster than I did :)
OAuth is just an API that Google gives out to developers to let them authenticate Google accounts in other manners other than just going on google.com - for example through a programmatic way.
Authentication is the basis of it, but through OAuth you're able to retrieve lots of information from a specific Google account (calendar info, contacts etc.)
To implement this you would need to read more on their website:
https://developers.google.com/identity/protocols/OAuth2

Categories

Resources