Symfony: implementing authentication from and external project - symfony

I have 3 symfony projects each one has it's own login page.
I want to make another symofony project that will work as the authentication gate, where a user can login to the other projects from it.
How can I achieve this ?

You have to install a SSO (like CAS for example) on a server.
And then use this SSO on your project : https://github.com/PRayno/CasAuthBundle (if you use CAS)

Related

ASP.NET Web-API Facebook login

I'm developing an Android App with an ASP.NET Wep-API Backend. Currently i have problems with the Facebook login. I want to login the users with the FB Access Token i get by the Facebook Android SDK. Is this possible? I thought i read something about that this is possible without a workarround by directly post the token to the /signin-facebook endpoint, but i can't find that solution anymore. So here is my question:
Is it possible to login/register to an ASP.NET Web-API directly with the facebook token? Or do i have to implement a workaround?
Best regards
The Web API comes with OWIN which then allowing you to implement (or activate) Access token login. You need to register to Facebook developer in order to get the app Id and secret key.
You can install in your web api project using nuget:
Install-Package Microsoft.Owin.Security.Facebook -Version 2.1.0
More detail.. you can try follow the link here

PirahnaCMS Manager using Organizational Authentication in project

While using Windows Organizational authentication in the ASP.net MVC project, I am unable to access the /Manager portion of PirahnaCMS. Whenever I attempt to login, it just redirects back to the login page. Is there a solution to this problem, or a workaround?
Someone asked this question, but no one posted a solution: How to get to Dashboard
Best Regards,
Saad
The Piranha CMS manager uses forms authentication. If you've configured another form of authentication in your main web.config the manager login won't work. In the upcoming version (2.3.0) the authentication mechanism will be replaceable, but in the current version the manager needs forms authentication.
You have two possible solutions:
1) Try configure the manager area to use Forms authentication by adding a separate web.config to this area.
2) Set the "front-application" to run in passive mode, i.e. disable the manager. Add a different web without the front-end and just the manager pointing to the same database.
Regards
HÃ¥kan

SSO between ASP.Net and JSP

I built an ASP.Net MVC 4 application which uses forms authentication by means of a custom membership provider inheriting from the Simple Membership.
Everything is working fine, but now I have a new requirement: I need to integrate a JSP application with mine.
This means that it has to authenticate against the same user database of my application and that they should somehow share the session in order to achieve a kind of Single Sign-On among the two applications (if an user is already authenticated in the ASP.Net application, he should be able to access the JSP application without logging in again, and vice-versa).
What architecture do you suggest me to use?
I would like to change as little as possible the ASP.Net application.
Thanks!
If you need to auhtenticate accross different domains:
You can implement your own security token service (like facebook, google does) Here is some ready to use implementation: http://thinktecture.github.io/Thinktecture.IdentityServer.v2/
If the sites are running on the same domain (subdomain), then you can try to share an authentication cookie within these domains.
An explaining article: http://www.codeproject.com/Articles/106439/Single-Sign-On-SSO-for-cross-domain-ASP-NET-applic

External website in .NET and Active Directory

I'm building a website and I need authenticate a User using Active Directory.
My website is on a different network and IP from the Server where the Active Directory is running (it is in a completely different network and domain).
I would like to know if is possible build an Login Page which could authenticate an User on a remote AD.
Thanks for your time.
One way of doing it would be to use LDAP to validate the supplied user credentials. Here is an example from Microsoft on how you could do it.
You should not deploy any web services on an Active Directory server.
You can use System.Directoryservices.Accountmanagement namespace classes (.NET 4) or using ADSI.
I had a similar situation to this, and the only way I could think to do it was like this:
Create a very small website on the server with Active Directory, which uses windows authentication
Have this website redirect to your main website, with some form of login key in the URL (best if generated on the fly) if the user authenticated.
Don't think there is any way for you to use the authentication over the external website other than along these lines.

Is it possible to have both Forms Authentication and Windows Authentication in an ASP.NET site?

I have a site where the vast majority of the content will be secured using Forms Authentication. However there is one sub folder that will be used internally by the administrative staff. I would like to secure this folder using Windows Authentication. Is that possible? Would I have to make the admin folder a virtual directory?
CLARIFICATION: There is no need for the administrative staff to access the main site. They are really two separate sites/apps. Regular users will access the main application via Forms Authentication (and never access the admin folder). And admin users will access the admin application via Windows Authentication (and never access the main site).
Thanks,
Corey
Yes, it's possible but you have to build a custom membership provider or an interface to allow for it. It is not possible to specify individual authentication methods on sub-folders unless they are in completely separate projects/application domains.
One method to accomplish this would be to use an LDAP membership provider and change the ldap connection based on the username (if there is a discernible method of doing this).
One other method would be to provide a separate website that uses the Windows authentication to perform the login and then constructs a custom cookie for the user and transfers them back to the original website identifying the individual as a member of the administrative staff.
Then the folder could be secured using the <location> elements in the web.config.
If I was going to build a site with Mixed authentication, I would setup the site to use webforms. I would then setup a virtual application inside of this application that consisted of the same forms auth web.config information but set to use Windows Auth.
On the login page of the windows auth site after you validate their credentials I would then manually call FormsAuthentication to create the auth token. At this point you can then redirect the user to the Forms Auth site and they should be logged in (as long as all the forms auth cookie information is the same for both sites, this might also include needing to setup the same machine keys for both applications).
I haven't done this specifically but this should definitely be a viable (and probably one of the most optimal) solutions.
It may be as simple as right-clicking on the admin folder in Windows Explorer and setting the rights in the Security tab.
Put the administration site in its own application - by right clicking on the folder in IIS manager and and choose convert to application.
Once that's done you can adjust the authentication method on the application by highlighting the application folder in IIS manager and then choosing authentication and adjusting them (or you can do it the hard way via web.config if you can't remote into the machine).

Resources