Closed dro-sh closed 4 years ago
asked for collective mind help here: https://discourse.aurelia.io/t/challenge-2-help-a-fellow-developer/915
mmm, All I can tell now that ASP.NET+webpack 3.3+Aurelia OIDC works on my machine using a integrated authority. That means this plugin with pushState works on IIS.
Also you refer to the demo project, I tested this one also. (Ps the link is not working in your description) This is a http app combined with https://demo.identityserver.io as authority and working in IIS on my machine.
@gerbendekker I published this template combined with https://demo.identityserver.io as authority. But got the same. http://drogserj.ddns.net/Nugas/pref (sorry for http)
I think its a bug where the routes are created by this plugin.
Look at the differences when compare the href /fetch-data
vs relativeHref /Nugas/pref/signin-oidc
@shaunluttin /Nugas/pref/signin-oidc
should be /signin-oidc
here.
@gerbendekker maybe it don't work because I configured routerConfig.options.root = "/Nugas/pref";
? It is necessary for PushState.
I think I found reason. Method getPath
return pathname
of anchor, which have /Nugas/pref/signin-oidc
value.
I propose next solution. Aurelia's pushState requeres to set routerConfiguration.options.root
, which value indicates to tag base. Therefore tag base will always included and it's baseURI will correspond to site URL.
OpenIdConnectRouting.prototype.getPath = function (uri) { + var anchor = this.convertUriToAnchor(uri); + var siteUrl= document.getElementsByTagName("base")[0].baseURI; + return anchor.href.replace(siteUrl, ""); };
Is's all changes. What do you think?
Thank you for looking in to this. I appreciate it.
Hi, I had the similiar problem with system js and webpack when published on IIS
This is because it is trying to read static files.
Use url rewrite to set the redirect paths.
If you have Url rewrite module installed then add this web.config file in the root level of application on production.
If not first install Url rewrite module from microsoft and then add this web.config file. Once you add the web.config as shown below, the Urlrewrite will pick up the rules set up from the web.config and wont look for static files.
<configuration>
<system.webServer>
<!-- this is needed when iis is unable to read json files because of mime type missing -->
<!-- <staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent> -->
<rewrite>
<rules>
<remove name="redirect all requests" />
<rule name="redirect all requests" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Hope this helps.
Hi, I will be closing up stale issues by the end of the week.
Are you still experiencing this issue? Feel free to close this yourself. If you are still experiencing this issue, let me know as well, thanks!
I don't use it. So I can't say does it work.
I have my own idsr app, that works fine and it is published on my IIS server (maybe it dont good idea, but thus I can check how it will work in production). Also I have my au-app based on AspNetCore.SpaTemplates. But after webpack 4 was released, I modernized this template to work with webpack 4. I spend a lot of time to do this but point was reached. After that I connected and set up aurelia-open-id-connect plugin. In debug all works fine. User can authorize and app can do request to API . But I decided to check how it will work after publish also on my IIS server. And I have one problem:
app.com/Name/account
).app.com/Name/au-app/Name/au-app/signin-oidc
)./Name/au-app/signin-oidc
).