Last post Jun 20, 2017 09:59 AM by PatriceSc
Jun 12, 2017 09:31 AM|Ashvini2004|LINK
I have recently upgrade my OS to windows 10.In one of my MVC project one login page is there so internally one site is hosted on my local which shows Login page and after login it should redirect to other website which is the same solution.
In first project which shows login page has method called 'Authenticate' which has code as below,
private void Authenticate(string userName)
ClaimsIdentity identity = new ClaimsIdentity(AuthenticationTypes.Federation);
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, userName));
identity.AddClaim(new Claim(ClaimTypes.Name, userName));
ClaimsPrincipal principal = new ClaimsPrincipal(identity);
var token = new System.IdentityModel.Tokens.SessionSecurityToken(principal); System.IdentityModel.Services.FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(token);
So first it authenticates user and then redirects to other website url as below,
After calling above redirect method it's showing following popup message and doesn't redirects,
'do you want to allow this website to open an app on your computer'?
and shows to select some APP to open with.If click 'Allow' then does nothing.
I tried following things but it didn't work,
1. Changed 'Change User Account Control settings' to 'Never Notify'.
2.In Internet Explorer --> added as trusted site and checked 'Allow pro-grammatically clipboard access'.
3. In Internet Explorer--> Security -->Allow Active content to run in files on My Computer.
Can you please help me on this.
Jun 12, 2017 10:36 AM|PatriceSc|LINK
Do you really expect a local application to be launched? If not I would use F12 to inspect the http query. Could it be a wrong mime type making IE to attempt launching a local app to handle this mime type ?
Jun 12, 2017 11:13 AM|Ashvini2004|LINK
I couldn't get what you mean to check for wrong mime type.Can you please mention in detail what needs to be checked and how?
And both applications are on localhost only.
Jun 12, 2017 11:33 AM|PatriceSc|LINK
Try F12 Request in your browser to inspect the http query. See for example
https://stackoverflow.com/questions/15148497/in-chrome-whats-the-simplest-way-to-view-the-mime-type-of-a-document and look at the "Content-Type".
I expect an attempt to load a local application if :
- you are using a ms-appx uri
- you are using a mime type that the browser doesn't know to handle
In your case it doesn't seems to be expected at all.
Jun 12, 2017 12:15 PM|Ashvini2004|LINK
In developer tools -> netwrok--> headers its displaying following things,
So what should i check to find my issue?
Jun 12, 2017 12:55 PM|PatriceSc|LINK
I meant checking the content type as shown in the link I posted (as shown by this image):
For now I'm trying to understand why you would see a "Do you want to allow this website to open an app on your computer ?"' message. It seems to me that the issue is not answering yes doesn't work but rather than this message shouldn't show up at all.
Jun 12, 2017 02:26 PM|Ashvini2004|LINK
One thing i noticed If i select 'Allow' for this message and selects to search for an app it looks for 'localhost' in store and it didn't find.
And on developer tool i found following things,Can you please check if you can get any idea.
Jun 12, 2017 02:42 PM|PatriceSc|LINK
You have one localhost site only?
http://localhost:42331 is hardcoded in your code ??? Could it be that your localhost is now
http://localhost:61011 rather than previosuly localhost:42331 ? And so as localhost:42331 doesn't exists on this particular machine it would cause this unexpected behavior ?
If confirmed, in VS you can check a checkbox so that the port name is part of the project file and so the same port number should be now used everywhere even if you get this project on some other machine.
Jun 12, 2017 03:07 PM|Rohit Kukreti|LINK
Try using same machine key tag in web.config for both the web apps on your local machine. Replace the validationKey and decryptionKey with your local values
<machineKey validationKey='' decryptionKey=''
Read more about machine key - https://msdn.microsoft.com/en-us/library/w8h3skw9(v=vs.100).aspx
Google for generating a machine key
Jun 14, 2017 09:31 AM|Ashvini2004|LINK
We have http://localhost:61011 this site which only does user validation and after login it redirects to http://localhost:42331 and in IIS only one site
needs to be hosted i.e. http://localhost:61011.This was working on my machine previously, before installing windows 10.Also it works on other developer's machine.
And about the machine key solution which you mentioned i tried but it also not working.I generated machine key from IIS and copied in web.config still not working.
I am really struggling to solve this issue.
Jun 20, 2017 09:49 AM|AngelinaJolie|LINK
it seems that it should be return Redirect("http://localhost:42331");
And i suggest that you could use a workaround solution .
1: Use ajax to ask your action result :
return Json(true, JsonRequestBehavior.AllowGet);
2: then in js:
Jun 20, 2017 09:59 AM|PatriceSc|LINK
I would expect the browser asking confirmation for launching an app if using a msappx: prefix or if the content type is not handled by the browser.
Have you tried F12 to inspect the http query that triggers this dialog ?
Edit: do you have Flash content? This is Windows 10 Creators Update ? Don't have it yet but I believe to have seen they'll now ask confirmation before loading Flash content.