📌  相关文章
📜  OAuth with axios react native - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:13.735000             🧑  作者: Mango

代码示例1
const axios = require('axios');
const oauth = require('axios-oauth-client');
const getAuthorizationCode = oauth.client(axios.create(), {
  url: 'https://oauth.com/2.0/token',
  grant_type: 'authorization_code',
  client_id: 'foo',
  client_secret: 'bar',
  redirect_uri: '...',
  code: '...',
  scope: 'baz',
});

const auth = await getAuthorizationCode(); // => { "access_token": "...", "expires_in": 900, ... }