Forms Authentication with 2 different apps, same login.aspx

Discussion in 'ASP .Net' started by djhexx@gmail.com, Jul 12, 2006.

  1. Guest

    Hi. We have an asp.net intranet application written in VB that uses
    forms authentication for all it's pages. I have a C# asp.net
    application that I just wrote. The company would like the C#
    application to authenticate using the same mechanism as the intranet
    app. Therefore...if I try to login to the c# app, it should redirect
    me to the intranet login. Once I pass authentication, I should be able
    to access the c# app.

    Now. Here is a piece of my c# apps web.config:

    <authentication mode="Forms">
    <forms loginUrl="http://intranetURL/logon.aspx"
    name="adAuthCookie" timeout="60" path="/">
    </forms>
    </authentication>

    When I try to access the C# apps page, it redirects me to logon.aspx as
    intended. But once I login, it doesn't authenticate me for the C#
    app.. If I try to go back to the C# app, it just takes me right back
    to login.

    An easy solution would be to just to basically merge the c# and the vb
    project into one and it would work fine...but...alas...you can't mix
    the two languages. How can I get authentication working between to
    apps of different language with the same form mechanism?

    If you need any more specific information, I will gladly give. Thanks
    in advance!!
    , Jul 12, 2006
    #1
    1. Advertising

  2. I am not sure. But you can try to put C# applications into the same directory
    as VB application. Or do something similar.

    David

    "" wrote:

    > Hi. We have an asp.net intranet application written in VB that uses
    > forms authentication for all it's pages. I have a C# asp.net
    > application that I just wrote. The company would like the C#
    > application to authenticate using the same mechanism as the intranet
    > app. Therefore...if I try to login to the c# app, it should redirect
    > me to the intranet login. Once I pass authentication, I should be able
    > to access the c# app.
    >
    > Now. Here is a piece of my c# apps web.config:
    >
    > <authentication mode="Forms">
    > <forms loginUrl="http://intranetURL/logon.aspx"
    > name="adAuthCookie" timeout="60" path="/">
    > </forms>
    > </authentication>
    >
    > When I try to access the C# apps page, it redirects me to logon.aspx as
    > intended. But once I login, it doesn't authenticate me for the C#
    > app.. If I try to go back to the C# app, it just takes me right back
    > to login.
    >
    > An easy solution would be to just to basically merge the c# and the vb
    > project into one and it would work fine...but...alas...you can't mix
    > the two languages. How can I get authentication working between to
    > apps of different language with the same form mechanism?
    >
    > If you need any more specific information, I will gladly give. Thanks
    > in advance!!
    >
    >
    =?Utf-8?B?ZGF2aWQ=?=, Jul 12, 2006
    #2
    1. Advertising

  3. Guest

    Can you do that though? It is my understanding that 2 different apps
    would require their own web.config file...Can't have 2 of those in the
    same folder...perhaps there is a way I can check for the session
    variable \ cookie that the authentication mechanism uses in the C# app
    and if it doesn't exist, redirect to the VB's login.aspx? hmm...anyone
    else know of a best practices approach to this?

    david wrote:
    > I am not sure. But you can try to put C# applications into the same directory
    > as VB application. Or do something similar.
    >
    > David
    >
    > "" wrote:
    >
    > > Hi. We have an asp.net intranet application written in VB that uses
    > > forms authentication for all it's pages. I have a C# asp.net
    > > application that I just wrote. The company would like the C#
    > > application to authenticate using the same mechanism as the intranet
    > > app. Therefore...if I try to login to the c# app, it should redirect
    > > me to the intranet login. Once I pass authentication, I should be able
    > > to access the c# app.
    > >
    > > Now. Here is a piece of my c# apps web.config:
    > >
    > > <authentication mode="Forms">
    > > <forms loginUrl="http://intranetURL/logon.aspx"
    > > name="adAuthCookie" timeout="60" path="/">
    > > </forms>
    > > </authentication>
    > >
    > > When I try to access the C# apps page, it redirects me to logon.aspx as
    > > intended. But once I login, it doesn't authenticate me for the C#
    > > app.. If I try to go back to the C# app, it just takes me right back
    > > to login.
    > >
    > > An easy solution would be to just to basically merge the c# and the vb
    > > project into one and it would work fine...but...alas...you can't mix
    > > the two languages. How can I get authentication working between to
    > > apps of different language with the same form mechanism?
    > >
    > > If you need any more specific information, I will gladly give. Thanks
    > > in advance!!
    > >
    > >
    , Jul 12, 2006
    #3
  4. Guest

    Oh yeah...and if I decided to just read the other apps session variable
    to determine authentication, how can I do that from another app?

    wrote:
    > Can you do that though? It is my understanding that 2 different apps
    > would require their own web.config file...Can't have 2 of those in the
    > same folder...perhaps there is a way I can check for the session
    > variable \ cookie that the authentication mechanism uses in the C# app
    > and if it doesn't exist, redirect to the VB's login.aspx? hmm...anyone
    > else know of a best practices approach to this?
    >
    > david wrote:
    > > I am not sure. But you can try to put C# applications into the same directory
    > > as VB application. Or do something similar.
    > >
    > > David
    > >
    > > "" wrote:
    > >
    > > > Hi. We have an asp.net intranet application written in VB that uses
    > > > forms authentication for all it's pages. I have a C# asp.net
    > > > application that I just wrote. The company would like the C#
    > > > application to authenticate using the same mechanism as the intranet
    > > > app. Therefore...if I try to login to the c# app, it should redirect
    > > > me to the intranet login. Once I pass authentication, I should be able
    > > > to access the c# app.
    > > >
    > > > Now. Here is a piece of my c# apps web.config:
    > > >
    > > > <authentication mode="Forms">
    > > > <forms loginUrl="http://intranetURL/logon.aspx"
    > > > name="adAuthCookie" timeout="60" path="/">
    > > > </forms>
    > > > </authentication>
    > > >
    > > > When I try to access the C# apps page, it redirects me to logon.aspx as
    > > > intended. But once I login, it doesn't authenticate me for the C#
    > > > app.. If I try to go back to the C# app, it just takes me right back
    > > > to login.
    > > >
    > > > An easy solution would be to just to basically merge the c# and the vb
    > > > project into one and it would work fine...but...alas...you can't mix
    > > > the two languages. How can I get authentication working between to
    > > > apps of different language with the same form mechanism?
    > > >
    > > > If you need any more specific information, I will gladly give. Thanks
    > > > in advance!!
    > > >
    > > >
    , Jul 12, 2006
    #4
  5. Can you ference other application in Visual Studio? Does it work?

    David

    "" wrote:

    > Oh yeah...and if I decided to just read the other apps session variable
    > to determine authentication, how can I do that from another app?
    >
    > wrote:
    > > Can you do that though? It is my understanding that 2 different apps
    > > would require their own web.config file...Can't have 2 of those in the
    > > same folder...perhaps there is a way I can check for the session
    > > variable \ cookie that the authentication mechanism uses in the C# app
    > > and if it doesn't exist, redirect to the VB's login.aspx? hmm...anyone
    > > else know of a best practices approach to this?
    > >
    > > david wrote:
    > > > I am not sure. But you can try to put C# applications into the same directory
    > > > as VB application. Or do something similar.
    > > >
    > > > David
    > > >
    > > > "" wrote:
    > > >
    > > > > Hi. We have an asp.net intranet application written in VB that uses
    > > > > forms authentication for all it's pages. I have a C# asp.net
    > > > > application that I just wrote. The company would like the C#
    > > > > application to authenticate using the same mechanism as the intranet
    > > > > app. Therefore...if I try to login to the c# app, it should redirect
    > > > > me to the intranet login. Once I pass authentication, I should be able
    > > > > to access the c# app.
    > > > >
    > > > > Now. Here is a piece of my c# apps web.config:
    > > > >
    > > > > <authentication mode="Forms">
    > > > > <forms loginUrl="http://intranetURL/logon.aspx"
    > > > > name="adAuthCookie" timeout="60" path="/">
    > > > > </forms>
    > > > > </authentication>
    > > > >
    > > > > When I try to access the C# apps page, it redirects me to logon.aspx as
    > > > > intended. But once I login, it doesn't authenticate me for the C#
    > > > > app.. If I try to go back to the C# app, it just takes me right back
    > > > > to login.
    > > > >
    > > > > An easy solution would be to just to basically merge the c# and the vb
    > > > > project into one and it would work fine...but...alas...you can't mix
    > > > > the two languages. How can I get authentication working between to
    > > > > apps of different language with the same form mechanism?
    > > > >
    > > > > If you need any more specific information, I will gladly give. Thanks
    > > > > in advance!!
    > > > >
    > > > >

    >
    >
    =?Utf-8?B?ZGF2aWQ=?=, Jul 13, 2006
    #5
  6. Guest

    I found a great simple solution to my problem here:

    http://www.codeproject.com/aspnet/aspnetsinglesignon.asp

    Thanks for all who tried to help.

    david wrote:
    > Can you ference other application in Visual Studio? Does it work?
    >
    > David
    >
    > "" wrote:
    >
    > > Oh yeah...and if I decided to just read the other apps session variable
    > > to determine authentication, how can I do that from another app?
    > >
    > > wrote:
    > > > Can you do that though? It is my understanding that 2 different apps
    > > > would require their own web.config file...Can't have 2 of those in the
    > > > same folder...perhaps there is a way I can check for the session
    > > > variable \ cookie that the authentication mechanism uses in the C# app
    > > > and if it doesn't exist, redirect to the VB's login.aspx? hmm...anyone
    > > > else know of a best practices approach to this?
    > > >
    > > > david wrote:
    > > > > I am not sure. But you can try to put C# applications into the same directory
    > > > > as VB application. Or do something similar.
    > > > >
    > > > > David
    > > > >
    > > > > "" wrote:
    > > > >
    > > > > > Hi. We have an asp.net intranet application written in VB that uses
    > > > > > forms authentication for all it's pages. I have a C# asp.net
    > > > > > application that I just wrote. The company would like the C#
    > > > > > application to authenticate using the same mechanism as the intranet
    > > > > > app. Therefore...if I try to login to the c# app, it should redirect
    > > > > > me to the intranet login. Once I pass authentication, I should be able
    > > > > > to access the c# app.
    > > > > >
    > > > > > Now. Here is a piece of my c# apps web.config:
    > > > > >
    > > > > > <authentication mode="Forms">
    > > > > > <forms loginUrl="http://intranetURL/logon.aspx"
    > > > > > name="adAuthCookie" timeout="60" path="/">
    > > > > > </forms>
    > > > > > </authentication>
    > > > > >
    > > > > > When I try to access the C# apps page, it redirects me to logon.aspx as
    > > > > > intended. But once I login, it doesn't authenticate me for the C#
    > > > > > app.. If I try to go back to the C# app, it just takes me right back
    > > > > > to login.
    > > > > >
    > > > > > An easy solution would be to just to basically merge the c# and the vb
    > > > > > project into one and it would work fine...but...alas...you can't mix
    > > > > > the two languages. How can I get authentication working between to
    > > > > > apps of different language with the same form mechanism?
    > > > > >
    > > > > > If you need any more specific information, I will gladly give. Thanks
    > > > > > in advance!!
    > > > > >
    > > > > >

    > >
    > >
    , Jul 13, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. frekster
    Replies:
    1
    Views:
    917
    frekster
    Sep 14, 2005
  2. Cowboy \(Gregory A.  Beamer\)

    Re: Forms authentication - after login it goes to default.aspx

    Cowboy \(Gregory A. Beamer\), Oct 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    Cowboy \(Gregory A. Beamer\)
    Oct 7, 2006
  3. Pascal Blanchard
    Replies:
    0
    Views:
    233
    Pascal Blanchard
    Aug 17, 2004
  4. Pascal Blanchard
    Replies:
    1
    Views:
    268
    Pascal Blanchard
    Aug 18, 2004
  5. Keltex
    Replies:
    1
    Views:
    379
    Dominick Baier [DevelopMentor]
    Jan 24, 2006
Loading...

Share This Page