This package is deprecated as part of ECORFC-621. Atlassian Connect frameworks and supporting libraries will reach end of support in December 2026. Migrate Connect apps to Forge: https://developer.atlassian.com/platform/adopting-forge-from-connect/
var oauth2 = require('@atlassian/atlassian-oauth2');
var options = {
hostBaseUrl: 'https://instance.atlassian.net',
oauthClientId: '{oauth client id your add-on was given at installation}',
sharedSecret: '{the shared secret your add-on was given at installation}',
userKey: '{the userkey of the user to retreive the token for}',
scopes: ['{an array of scopes requested}']
};
oauth2.getAccessToken(options).then(function (token) {
console.log(token);
// token.access_token = '{your access token}'
// token.expires_in = '{expiry time}'
// token.token_type = 'Bearer'
});
Atlassian 连接 OAuth2 库注意:该包已被作者标记为弃用——This package is deprecated as part of ECORFC-621. Atlassian Connect frameworks and supporting libraries will reach end of support in December 2026. Migrate Connect apps to Forge: https://developer.atlassian.com/platform/adopting-forge-from-connect/