gpt4 book ai didi

expo auth azure ad exchange token(Expo Auth Azure广告交换令牌)

转载 作者:bug小助手 更新时间:2023-10-26 20:32:17 35 4
gpt4 key购买 nike



Ran on ios in expo go.
Authorization token works correctly but then cannot redeem. Gives me the error below, I looked but the solution to this error is an to put an origin header, which isn't possible in ios.

在EXPO GO中运行iOS。授权令牌工作正常,但无法兑换。给了我下面的错误,我看了一下,但这个错误的解决方案是放置一个起始头,这在iOS中是不可能的。


More info: AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only beredeemed via cross-origin requests.

更多信息:AADSTS9002327:为‘Single-Page Application’客户端类型颁发的令牌只能通过跨域请求进行兑换。


const discovery = AuthSession.useAutoDiscovery('https://login.microsoftonline.com/' + tenantId +'/v2.0');

const redirectUri = AuthSession.makeRedirectUri({scheme: "{my scheme}", path: 'auth'});

// Request
const [request, result, promptAsync] = AuthSession.useAuthRequest(
{
clientId,
scopes: ["User.Read"],
redirectUri,
prompt: AuthSession.Prompt.SelectAccount
},
discovery,
);

async function getAuthToken() {
promptAsync().then(async (codeResponse) => {
if (request && codeResponse?.type === 'success' && discovery) {
AuthSession.exchangeCodeAsync(
{
clientId,
code: codeResponse.params.code,
extraParams: request.codeVerifier
? { code_verifier: request.codeVerifier }
:undefined,
redirectUri,
scopes: request.scopes
},
discovery,
).then((response) => {
//Success
}).catch(e => {console.log(e)});
}
});
}

I have tried getting the token like in the repo https://github.com/pinecat/azure-ad-graph-expo

我试过像在回购https://github.com/pinecat/azure-ad-graph-expo得到令牌


更多回答
优秀答案推荐
更多回答

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com