我正在构建一个使用Microsoft Graph API进行身份验证的Azure Functions应用程序。我创建了一个processCode
函数作为我的重定向URI,它使用Graph API发送的代码生成Graph令牌。
但是,Azure Functions在其调用中使用code
查询字符串参数来传递功能键。
我是否可以将Graph API重定向URI配置为使用code
以外的其他查询字符串参数?
基本上,改变
https://myapp/api/processCode?code=GRAPH-CODE (conflicting code parameter)
到
https://myapp/api/processCode?code=FUNCTIONS-KEY&graphcode=GRAPH-CODE
答案 0 :(得分:4)
You cannot. The Tombstone
query parameter is defined by the OAuth 2.0 specification (RFC 6249
).
What you might be able to do instead is change your code=
from response_mode
to query
when you request the authoirzation code. This changes how the code itself gets returned. Rather than issuing a form_post
to your GET
with the redirect_uri
in the authorization it issues a code
to the POST
with the redirect_uri
in the body (i.e. code
).
You'd have to adjust your Azure Function to listen for application/x-www-form-urlencoded
and parse the content from the body instead of the query string. Otherwise, everything should remain pretty much the same. The POST
closely resembles the query string format (application/x-www-form-urlencoded
).