最近の検索
最近の検索はありません

IT Support
参加日2022年6月10日
·
前回のアクティビティ2022年6月14日
フォロー中
0
フォロワー
0
合計アクティビティ
2
投票
0
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ IT Support
IT Supportさんがコメントを作成しました:
コメントSecurity and user access in Zendesk Support
Good evening,
In trying to setup the oauth authorization flow, I am getting a 405 on the preflight request to /oauth/tokens. I have double, triple and quadruple checked my code against the docs and examples, but with no success. Am I missing something in understanding what Zendesk expects to grant an access token? For example, am I running into errors because my origin is http://localhost:8081(i.e. not https)? Is there a way to avoid the sending a preflight with the OPTIONS method that's returning the 405?
onMounted(() => {
let authCode;
if (route.query.code) {
authCode = route.query.code
requestZendeskAccessToken(authCode)
};
})
const requestZendeskAccessToken = (authCode) => {
const url = "https://{SUBDOMAIN}.zendesk.com/oauth/tokens";
const data = {
'grant_type': 'authorization_code',
'code': authCode,
'client_id': '{CLIENT_ID}',
'client_secret': '{SECRET}',
'redirect_uri': 'http://localhost:8081/order/search',
'scope': 'read write'
}
axios.post(url, data, {
headers: {'Content-Type': 'application/json'}
})
.then(data => console.log("Successful Access Token Req ", data))
.catch(err => console.log("Failed Access Token Req ", err));
}
// ...Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
コメントを表示 · 編集日時:2022年6月14日 · IT Support
0
フォロワー
1
投票
0
コメント