简体   繁体   中英

how to use firebase token authentication with a web api2 controller

I have a firebase authentication token that i am trying to pass to a web api controller. I am following this post here. stackoverflowpost

I have the bearer token in the $http request headers. 角度的

I took care of cors(unless I missed something). The end point in my api project is receiving the request with null headers. So I am trying to debug what is wrong but without any specific errors I am not sure where to look api项目

You can get the value of an element "Authorization" in header by using following code:

  string firebaseAuthToken = string.Empty;
    firebaseAuthToken = actionContext.Request.Headers.GetValues("Authorization").First();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM