Subdomaining in rails 3 - ruby-on-rails-3

I am working on a project which is a app store. User can subscribe to many applications. I am creating a subdomain for each user and applications he subscribed are again running on subdomains.
Eg.
1). One user registers and selects subdomain as "mysubdomain". Then after logging in he will be accessing everything as "mysubdomain.appstore.com".
2). After registration he subscribes an app, say, "discussion-board".
3). Then the discussion board will be running on "discussion-board.mysubdomain.appstore.com"
Application which allows user which is running on app_store.com and the utility app discussion-board are two different applications.
I know the question sounds more like serverfault.com, but I am putting it here if it can be managed using rails.
I am using devise for authentication on rails 3

I'd recommend you review:
http://railscasts.com/episodes/221-subdomains-in-rails-3
And take a look at doing the separate apps as Rack middleware.

Related

Authenticating user without creating app manifest in teams app

Just because of authentication I need to create an app manifest and share the app manifest with users who want to test it .Is there a way to Authenticate user without creating app manifest so that I can directly share bot link with users.
Talking to your bot by ID is intended for basic testing purposes only. Any Teams-specific functionality you have added to your bot fails to work.
Doc ref: Talk to your bot directly by ID
In this example
Is is an OAUTH flow with Azure AD directory v2 without any app manifest.
This one is in java_springboot but you can find the same for your prefered langage in the samples directory. The number 18 (and all the others) in all samples is the example but in different langages.

How to work with guest Circuit users from smartphone apps?

I want to use circuit as a videocall system in a B2C environment in which only the backend call agents are Circuit users (but the end-clients are not!!).
The only way I see to establish a videocall would be by creating a new conversation, get the url guest link and send it to the end-client.
This could be a “not-that-bad” possibility in a PC web portal front end….but in the case of a smartphone app (ie Ionic-Cordova) that link would redirect the end client to the Circuit app download site, forcing the user to install Circuit app which would not be accepted in the general case.
Is there any other possibility to implement a use case like this from Smartphone apps by embedding the guest connectivity in the app making Circuit transparent for the end client? Any possibility by using a pool of dummy Circuit users to be assigned temporarily to the app users?
That's a good question. There are two problems as pointed out by you.
1. SDK cannot be used without an authenticated Circuit user
I.e. the SDK has no support for guest access other than retrieving the guest access link. Workarounds are:
a) use the guest link and have the non-Circuit users join using their Circuit web or mobile client, or
b) create a new conversation each time and use a pool of users. But this workaround does not look intuitive and have actually never tried it in an app.
2. Guest users require Circuit app
Again as pointed out correctly, if going with a) above, the mobile client users would need the Circuit app to join a guest session.
Conclusion
For desktop users 1a is probably the best option. But for mobile users you'd have to try a workaround with a pool of users.
We are aware of these limitation and are looking into a better solution to address your use case. I will update this post once we have more information of the details and timeframe.

Adding a Sandboxed app to Login Items

I have read through many questions here about launching my app on login. I have followed this awesome tutorial suggested many times. That tutorial does work. BUT...
The one side affect that comes from using a helper app and registering it using SMLoginItemSetEnabled is that my app does not show up inside the user's Login Items in System Preferences.
There are several apps in the App Store (such as PopClip and Dash) that do what I am trying to do. I just can't figure out how...
UPDATE: I found out from the Dash developer that Dash is actually not sandboxed. He also believes that PopClip is not either. This could explain things... https://alpha.app.net/kapeli/post/3975968
UPDATE #2: I just got confirmation from the PopClip dev that it indeed is not sandboxed as well. https://twitter.com/pilotmoon/status/313746294361427968
With the last 2 updates, I guess the answer is clear. As of today, there is no way to accomplish this with Sandboxed apps.
Hope it's not too late.
In Apple's "Daemons and Services Programming Guide":
Adding Login Items
There are two ways to add a login item: using the Service Management framework, and using a shared file list.
Login items installed using the Service Management framework are not visible in System Preferences and can only be removed by the application that installed them.
Login items installed using a shared file list are visible in System Preferences; users have direct control over them. If you use this API, your login item can be disabled by the user, so any other application that communicates with it it should have reasonable fallback behavior in case the login item is disabled.
In sandboxed environment, only Helper applications can be installed in login items. You need to create one, stored in the Contents/Library/LoginItems folder of the main application.
Then you can used SMLoginItemSetEnabled to set the helper as login item and ask the login item to start the main application.

PHPBB Authentication + Rails

I have a phpbb forum and i am developing a rails application that will be used for a mobile friendly app. I need a way to perform SSO between phpbb and rails.
I found a ruby gem called phpbb-auth on github but it hasn't been updated in over 3 years.
My initial thoughts were to mimic phpass (which i believe is what the latest phpbb uses) in rails and then just have rails reference the phpbb_users table when authenticating with Devise/Warden.
However, that task became daunting and would become just another lib to manage.
My next thought was to write a plugin for Warden to check for a phpbb_session and if its there, then continue. Otherwise redirect them to the phpbb login page.
Has anyone come across doing this before, and if so what was the method you used.
I doing same thing right now (already succeed actually).
So, you basically have several options depending on your setup/deployment. Consider following:
Will you deploy your rails app and phpbb on same domain or different domains?
Have both sites access to each other db.
Which authentication system you whish to use? So, you'd like rails (i.e. devise, authlogic or whatever) authenticate and handle users or phpbb db auth (i.e. storing logins and password in phpbb users table).
So far, I've implement auth through phpbb db auth + single domain with my app (phpbb: forum.example.com, my rails app is on: example.com for cookie sharing). In this case you can use code from gem you have mentioned (phpbb-auth). It's not very hard. Code is still working fine (with some adjustments probably).
BUT
I do not like it this way :) I consider my site as a main app and do not want forum to handle my users...
So, as I understand starting from phpbb 3 you can write plugin (API docs) for external auth for phpbb.
There are several examples in Python and Django in the net. Looks like this one for same domain + db access. And looks like this one for doing things remotely with JavaScript. Those are in Python, but there's not too much Python inside, only some examples :), so you can easily adopt them for rails, I think.
This question discuss same stuff, but in more generic way.

Share login status between WordPress blog and RoR app?

I'm using devise for authentication in my Rails application. I have a WordPress installation for the blog portion of the project (because I need several WP plugins).
Is it possible to integrate the user authentication from the RoR application into the blog, so that when someone logs into the app, then goes to the blog, their signed it status remains and shows up.
If that's possible, it should also be possible for them to log in while viewing the blog and then go straight to their page when they go to the app, right?
You have to store session information about WP and Rails session in one storage and check WP auth cookies on Rails application.