Owin Bearer Token Authentication + Authorize controller

后端 未结 4 1527
深忆病人
深忆病人 2020-12-24 13:40

I\'m trying to do authentication with Bearer tokens and owin.

I can issue the token fine using the grant type password and overriding GrantResour

4条回答
  •  眼角桃花
    2020-12-24 14:25

    I'm not sure if this helps but I had a problem with IsAuthenticated coming back false whilst using dependency injection (see SO question here) and it looked to because at the point of injection it hadn't been set by the Owin pipeline.

    I overcame it by lazy injecting the Principal. Either way I put together a really basic application (which is linked to in the above) to demonstrate the problem, but it might help you as it shows the Principal being set in the attribute and use of bearer authentication.

提交回复
热议问题