asp.net-core


UrlRewrite Middleware and Client Applications


I am not even sure if url rewriting will fit my use case but I have a feeling it might (using Microsoft.AspNetCore.Rewrite). I have a client served by my ASP.NET Core project with UseStaticFiles(). This same project also uses the default MVC with routes as follows in my startup Configure method:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}");
});
My client application does an out of band call which receives a callback from another service and this callback contains a url/hash fragment so that the client application can process whatever is in the url/hash fragment. Lets say this service replies with /callback#foo='bar'.
Just some more context, what is happening is that my client app is doing a login from an openid-connect provider, and on login, what happens is you get directed to the provider, this provider redirects you back to your application with the token in the hash fragment (on successful login), so when my ASP.NET Core application gets the request callback#foo=bar I want it to serve my static application in wwwroot with the hash fragment in place so my client side app can consume the hash fragment (which is the token returned by the provider)
Looks like you would like to serve a custom url for static files from the wwwroot. In that case,you can do this
app.Map("callback#foo=bar", subApp => subApp.UseStaticFiles());

Related Links

Securing a simple API with ASP.NET 5 [closed]
Redirect from API action to MVC action
Commanline build .NET Core
asp.NET 5 MVC6 Bearer Token Authorization
How to set redirect_uri parameter on OpenIdConnectOptions for ASP.NET Core
.NET Core 1.0 and EntityFramework 7 Not Compatible
Is it possible to use a custom ModelState validation provider in ASP.NET Core?
asp.net core mvc6 seeding Roles produces different results when repeating database creation
Setting the version number for .NET Core projects
Can one use Reportviewer Control in ASP.net Core
Migrating from OWIN to ASP.NET Core
Understanding ASP.NET Core Dependencies and Capabilities
dnx-watch stopped working and throwing ArgumentException because directory was not found
how to render date part segments with anchor taghelper in ASP.NET Core
Unable to target netstandard or netstandardapp in VS2015
Error building AspNet.Security.OpenIdConnect.Server

Categories

HOME
client
openstack
c#-4.0
jira
youtube-api-v3
cakephp-2.5
sql-server-2016
windows-server
opengl-es-2.0
mouse
medical
quicklook
circular-dependency
hex-editors
circuit
serverless-framework
libtiff
telephony
invantive-sql
excel-vba-mac
lldb
zapier
intentfilter
mps
dcevm
apache-commons-io
buck
tasklet
nameservers
calibre
perlin-noise
lxd
form-data
mozilla
qwerty
scaffold
swift3.0.2
sharefile
impersonation
hue
ansible-playbook
tasker
squib
pdf-reactor
jsch
termination
recursive-datastructures
knockout-components
sqlclient
nsarray
sybase-asa
r-forge
grails-tomcat-plugin
mathematica-frontend
actionbardrawertoggle
ios4
associative-array
phpcas
vhd
cannon.js
tarjans-algorithm
rgeo
apache-commons-fileupload
graph-api-explorer
coldbox
codeigniter-routing
preferences
xojo
htmlcleaner
xceed-datagrid
picturefill
ember-charts
typo3-neos
mbr
intentservice
floating-point-precision
ivyde
xsockets.net
spring-io
soundtouch
quartz-graphics
easy-install
xamlparseexception
trusted
viewswitcher
ticoredatasync
spring-portlet-mvc
xmlspy
xmemcached
remember-me
digest-authentication
coda-slider
bespin
user-friendly
nintendo-ds
sustainable-pace
django-notification

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App