【问题标题】:rewrite rules messing up web api 2 /token重写规则弄乱了 web api 2 /token
【发布时间】:2019-02-06 23:43:33
【问题描述】:

我正在尝试使用 OAuth 获取 angularjs + web api 2。基本上,我从 Visual Studio ASP.NET Web 应用程序模板中选择个人帐户。

我需要重写 Angular 的东西,但我发现这样做了,所以我无法为 OAuth 的东西获取我的 /token?这2个怎么玩好?

<rewrite>
      <rules>
        <rule name="angularjs routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>

【问题讨论】:

    标签: angularjs oauth asp.net-web-api2


    【解决方案1】:

    我发帖后总是收到这个>

    我将它添加到条件中并且它起作用了......

    <add input="{REQUEST_URI}" pattern="^/token" negate="true" />
    

    【讨论】:

      猜你喜欢
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-11
      • 2020-11-08
      相关资源
      最近更新 更多