代码之家  ›  专栏  ›  技术社区  ›  user441521

重写规则扰乱web api 2/token

  •  0
  • user441521  · 技术社区  · 7 年前

    我正在尝试用OAuth获得angularjs+WebAPI 2。基本上,我从VisualStudioASP中选择个人帐户。NET Web应用程序模板。

    我需要重写angular的东西,但我发现这使得我无法获得OAuth东西的/token?这两个怎么打得好?

    <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>
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   user441521    7 年前

    我总是在发布后收到此消息>&书信电报;

    我把这个加入到条件中,它起了作用。。。

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