Blank page during redirect to autosignin.aspx

Mar 28, 2013 at 10:25 AM
Hello,
I keep getting a blank page during the redirect to the autosignin.aspx.

In the providermapping I added my own ip-address (for test purposes) with different wildcard notations... like $config.ProviderMappings.Add("10.128*", "Windows Authentication")
Everything in this range would use Active Directory to automatically login to Sharepoint, correct?

I have no clue how to solve this... Please advice?
Thanks in advance!

Regards
Apr 10, 2013 at 9:27 PM
same issue here, can someone assist?
Apr 19, 2013 at 7:22 AM
My frist guess is that you missed a few characters in the IP range.
Try this instead: $config.ProviderMappings.Add("10.128..", "Windows Authentication")
Apr 19, 2013 at 10:40 AM
Thanks!

I'll try this...
Apr 29, 2013 at 3:57 PM
JHavermans wrote:
My frist guess is that you missed a few characters in the IP range.
Try this instead: $config.ProviderMappings.Add("10.128..", "Windows Authentication")
Nope, that did not work...
Still at a loss here...

Could it be a localization error? Change "Windows Authentication" in "Windows-verificatie"?
May 2, 2013 at 8:49 AM
Hi

I think is not possible to put an IP range like xxx.xxx..
Only a range with * at the end is authorized xxx.xxx.xxx.*

For the second anwer yes the name is localized.
In french you must write "Authentification Windows" instead of "Windows Authentication" because the display name is used in the code

Regards
Phil
May 30, 2013 at 9:42 AM
Edited May 30, 2013 at 9:51 AM
Hi,

Still not working.
I am debugging the code on the server at the moment.

The SPContext.Current is always NULL.
I don't if that is a debugging issue or the actual issue why it is not working for me...

Someone?

Thanks in advance.

Regards,
Hans

edit:
I don't think it is a debugging issue, if I change the code to write a file if SPContext.Current is NULL, it seems the context is also NULL.
Jun 6, 2013 at 3:33 PM
Unless you change the code, you may only use class "C" subnets.

Example: $config.ProviderMappings.Add("10.128.10.*", "Windows Authentication")

The above example specifies xxx.xxx.xxx.*, the first three octets must be specified or it will default to the "else" statement in the code.
Jun 7, 2013 at 9:52 AM
Hi

I have the same issue in some case.
It was when I create a site collection but not it's root web.

this is what I did :
  1. Create a site collection whit url http://base
  2. When it's done you can create the first web but I put choose later the template.
  3. Create a new site collection whit url http://base/sites/mixedauthentication
  4. Create your first web in the url http://base/sites/mixedauthentication with one of the purposed template
When you try to use the solution on the url http://base/sites/mixedauthentication you have this issue with SPContext.Current is null

To solve the issue you can create a web site in the url http://base or (like I do) I modify the part to get the web application in code creating a new method named GetWebApplication and passing the right url to get the web application
private SPWebApplication GetSPWebApplication()
        {
            SPWebApplication app = null;
            if (SPContext.Current == null || SPContext.Current.Site == null || SPContext.Current.Site.WebApplication == null)
            {
                SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ULSCategory, TraceSeverity.High, EventSeverity.Warning), TraceSeverity.High, "Le contexte Sharepoint n'existe pas\n On essaie de récupérer la WepApplication à l'aide de l'URL d'appel : " + Request.Url.ToString());
                SPSite site = null;
                try
                {
                    site = new SPSite(Request.Url.ToString());
                    app = site.WebApplication;
                }
                catch
                {
                    SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ULSCategory, TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, "Impossible de trouver la Web Application hébergeant le site situé à l'URL : " + Request.Url.ToString());
                }
                finally
                {
                    if (site != null)
                    {
                        site.Close();
                        site.Dispose();
                    }
                }
            }
            else
            {
                app = SPContext.Current.Site.WebApplication;
            }

            return app;
        }
Now the OnLoad method start like this
 protected override void OnLoad(EventArgs e)
        {
            SPWebApplication app = GetSPWebApplication();

            if(app == null) return;

            SignInConfiguration config = app.GetChild<SignInConfiguration>("SignInConfig");
I hope this helps
Jun 7, 2013 at 9:56 AM
Thanks Latortue and trinitytek,

I will try your suggestions and get back with the results!!

Thanks!
Jun 7, 2013 at 10:49 AM
Latortue wrote:
Hi

I have the same issue in some case.
It was when I create a site collection but not it's root web.

this is what I did :
  1. Create a site collection whit url http://base
  2. When it's done you can create the first web but I put choose later the template.
  3. Create a new site collection whit url http://base/sites/mixedauthentication
  4. Create your first web in the url http://base/sites/mixedauthentication with one of the purposed template
When you try to use the solution on the url http://base/sites/mixedauthentication you have this issue with SPContext.Current is null

To solve the issue you can create a web site in the url http://base or (like I do) I modify the part to get the web application in code creating a new method named GetWebApplication and passing the right url to get the web application
private SPWebApplication GetSPWebApplication()
        {
            SPWebApplication app = null;
            if (SPContext.Current == null || SPContext.Current.Site == null || SPContext.Current.Site.WebApplication == null)
            {
                SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ULSCategory, TraceSeverity.High, EventSeverity.Warning), TraceSeverity.High, "Le contexte Sharepoint n'existe pas\n On essaie de récupérer la WepApplication à l'aide de l'URL d'appel : " + Request.Url.ToString());
                SPSite site = null;
                try
                {
                    site = new SPSite(Request.Url.ToString());
                    app = site.WebApplication;
                }
                catch
                {
                    SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ULSCategory, TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, "Impossible de trouver la Web Application hébergeant le site situé à l'URL : " + Request.Url.ToString());
                }
                finally
                {
                    if (site != null)
                    {
                        site.Close();
                        site.Dispose();
                    }
                }
            }
            else
            {
                app = SPContext.Current.Site.WebApplication;
            }

            return app;
        }
Now the OnLoad method start like this
 protected override void OnLoad(EventArgs e)
        {
            SPWebApplication app = GetSPWebApplication();

            if(app == null) return;

            SignInConfiguration config = app.GetChild<SignInConfiguration>("SignInConfig");
I hope this helps
Hi,

When I run this code I receive the following errors in the ULS, you added in the code: (translated from French)

_The context does not exist Sharepoint is trying to recover WepApplication using the URL call: http://xxx-126/_login/autosignin.aspx?ReturnUrl=/sites/traveltest/_layouts/Authenticate.aspx?Source=%252Fsites%252Ftraveltest&Source=/sites/traveltest_

and

_Could not find Web application hosting the site located at URL:
http://xxx-126/_login/autosignin.aspx?ReturnUrl=/sites/traveltest/_layouts/Authenticate.aspx?Source=%252Fsites%252Ftraveltest&Source=/sites/traveltest_

Is there something wrong with the webapplication settings?

Thanks!

Regards,
Heisa
Jun 7, 2013 at 11:18 AM
Hi

the first massage is "normal", it indicate you the SPContext.Current is null.

For the second entry the message tell us a webapplication can't be reach with the url http://xxx-126/_login/autosignin.aspx?ReturnUrl=/sites/traveltest/_layouts/Authenticate.aspx?Source=%252Fsites%252Ftraveltest&Source=/sites/traveltest_
Are you sure a SPSite exist at the url http://xxx-126/ ?

Have you change the alternate access mapping ?

Regards
Phil
Jun 7, 2013 at 1:28 PM
Latortue wrote:
Hi

the first massage is "normal", it indicate you the SPContext.Current is null.

For the second entry the message tell us a webapplication can't be reach with the url http://xxx-126/_login/autosignin.aspx?ReturnUrl=/sites/traveltest/_layouts/Authenticate.aspx?Source=%252Fsites%252Ftraveltest&Source=/sites/traveltest_
Are you sure a SPSite exist at the url http://xxx-126/ ?

Have you change the alternate access mapping ?

Regards
Phil
Hi,

I have not changed the alternate access mappings...
There are currently two entries:
http://xxx-126
http://xxx-126:15849 (Central administration)

Thanks!

Regards,
Heisa
Jun 7, 2013 at 2:55 PM
Hi

To see if the site exists a simply test is that open an sharepoint powershell console and try to get the site collection using the url http://xxx-126/_login/autosignin.aspx?ReturnUrl=/sites/traveltest/_layouts/Authenticate.aspx?Source=%252Fsites%252Ftraveltest&Source=/sites/traveltest_
$site = Get-SPSite http://xxx-126...
Regards
Phil
Jun 7, 2013 at 3:12 PM
Jun 7, 2013 at 3:52 PM
Hi

Ok the url to your site collection is http://xxx-126/sites/traveltest does exist.

But in the url http://xxx-126/ have you an site collection ?
Beacause the url you pass to get the site collection is http://xxx-126/_login/autosignin.aspx

I think the problem come from here.
Your web application url is http://xxx-126/ but your site collection such url is http://xxx-126/sites/traveltest
You don't have a site collection in the url http://xxx-126/. It's the error you see in powershell

I'll see how to reach the web application otherwise


Regards
Phil
Jun 10, 2013 at 9:13 AM
Latortue wrote:
Hi

Ok the url to your site collection is http://xxx-126/sites/traveltest does exist.

But in the url http://xxx-126/ have you an site collection ?
Beacause the url you pass to get the site collection is http://xxx-126/_login/autosignin.aspx

I think the problem come from here.
Your web application url is http://xxx-126/ but your site collection such url is http://xxx-126/sites/traveltest
You don't have a site collection in the url http://xxx-126/. It's the error you see in powershell

I'll see how to reach the web application otherwise


Regards
Phil
Hi,

That is it!!!
I created a site collection http://xxx-126 and now the authentication works!!! Many, many thanks!! But is it common Sharepoint work method to create a site collection on the root? Because I could not find this requirement in the documentation of this tool....

Again, many thanks!!

Regards,
Hans