Skip to content

Commit bd278f6

Browse files
nessgorMrRefactoring
authored andcommitted
chore: update readme
1 parent c5fe9ec commit bd278f6

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

README.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ You can find the documentation [here](https://mrrefactoring.github.io/jira.js/).
5656

5757
There are several types of authentication to gain access to the Jira API. Let's take a look at a few of them below:
5858

59-
##### [Basic authentication](https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/)
59+
##### Email and API Token
6060

61-
Basic authentication allows you to log in with credentials. You can use username and password, but this login method is not supported in the online version and most standalone versions, so it's better to release API Token. Read how to do it [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) and use it together with email.
61+
To create an API Token, use this link: [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
6262

63-
Username and password example:
63+
Example of usage
6464

6565
```typescript
6666
import { Version3Client } from 'jira.js';
@@ -69,32 +69,37 @@ const client = new Version3Client({
6969
host: 'https://your-domain.atlassian.net',
7070
authentication: {
7171
basic: {
72-
username: 'YOUR_USERNAME',
73-
password: 'YOUR_PASSWORD',
72+
73+
apiToken: 'YOUR_API_TOKEN',
7474
},
7575
},
7676
});
7777
```
7878

79-
Email and API Token example:
79+
##### [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/)
80+
81+
Only the authorization token is currently supported. To release it, you need to read the [documentation](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/) and write your own code to get the token.
82+
83+
Example of usage
8084

8185
```typescript
8286
import { Version3Client } from 'jira.js';
8387

8488
const client = new Version3Client({
8589
host: 'https://your-domain.atlassian.net',
8690
authentication: {
87-
basic: {
88-
89-
apiToken: 'YOUR_API_TOKEN',
91+
oauth2: {
92+
accessToken: 'YOUR_ACCESS_TOKEN',
9093
},
9194
},
9295
});
9396
```
9497

95-
##### [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/)
98+
##### [Personal access token](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)
9699

97-
Only the authorization token is currently supported. To release it, you need to read the [documentation](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/) and write your own code to get the token.
100+
Personal access tokens (PATs) are a secure way to use scripts and integrate external applications with your Atlassian application. If an external system is compromised, you simply revoke the token instead of changing the password and consequently changing it in all scripts and integrations.
101+
102+
Personal access tokens are a safe alternative to using username and password for authentication with various services.
98103

99104
Example of usage
100105

@@ -104,24 +109,27 @@ import { Version3Client } from 'jira.js';
104109
const client = new Version3Client({
105110
host: 'https://your-domain.atlassian.net',
106111
authentication: {
107-
oauth2: {
108-
accessToken: 'YOUR_ACCESS_TOKEN',
109-
},
112+
personalAccessToken: 'secrectPAT',
110113
},
111114
});
112115
```
113116

114-
##### [Personal access token](https://id.atlassian.com/manage-profile/security/api-tokens)
117+
##### [Basic authentication](https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/)
115118

116-
To create a personal access token, use this link: [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
119+
Basic authentication allows you to log in with credentials. You can use username and password, but this login method is not supported in the online version and most standalone versions, so it's better to release API Token. Read how to do it [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) and use it together with email.
120+
121+
Example of usage
117122

118123
```typescript
119124
import { Version3Client } from 'jira.js';
120125

121126
const client = new Version3Client({
122127
host: 'https://your-domain.atlassian.net',
123128
authentication: {
124-
personalAccessToken: 'secrectPAT',
129+
basic: {
130+
username: 'YOUR_USERNAME',
131+
password: 'YOUR_PASSWORD',
132+
},
125133
},
126134
});
127135
```
@@ -152,7 +160,7 @@ try {
152160
console.log(error);
153161
}
154162
}
155-
````
163+
```
156164

157165
#### Example and using algorithm
158166

0 commit comments

Comments
 (0)