Comments (4)
from azure-devops-java-sdk.
Hey @champlin2, You don't necessarily have to use PAT to authenticate the REST API. There are two ways to authenticate, one is using PAT and other is using OAuth2.0. As described in the documentation you need to register your application to get a client id, client secret, callback url. The callback url will have the jwt token.
Using client id, client secret and callaback url create a Connection object. Specify tokenRefreshedHandler to refresh your auth token automatically when it expires.
Please use OAuthApi first to get the authorization endpoint and access token. OAuthApi has static methods,
- getAuthorizationEndpoint
- getAccessToken
- getRefreshToken
- hasTokenExpired (helper method to check if the token has expired)
OAuthApi injects the timestamp when a new access token is generated and you can use hasTokenExpired
to check and get the refresh token.
Once you have the access token, you can then create a connection object with that and call other Apis.
from azure-devops-java-sdk.
Hiya @champlin2, Please let me know if your issue is solved or you need any help. This issue will be closed after few days.
from azure-devops-java-sdk.
Cheers, good luck.
from azure-devops-java-sdk.
Related Issues (20)
- Json mapping issue when trying to read builds that couldn't run HOT 6
- Documentation of RestClient or Unit tests of RestClient needed HOT 3
- Push Changes Feature HOT 3
- Possible to compile with Java 8 HOT 5
- GitRepository does not support repositories with size greater than 2147483647 bytes HOT 2
- Add ability to get Retry-After value in response header HOT 2
- Parsing exception for ReleaseDefinition that has an an Environment that has Conditions. HOT 1
- Enhance the API to connect to on premise Azure DevOps server HOT 6
- GitApi 'getItems' does not include version in query string
- Git push does not work because JSON output does not match examples HOT 3
- Do you support pagination with the continuationToken HOT 11
- [Feature] Missing Pull Request Statuses object HOT 2
- [Improvement] Add more examples to GitApi.md HOT 1
- How to get the get the team capacity? HOT 2
- Azure Server HOT 6
- [Improvement] Add ability for GitApi.getRepositories() to include hidden repositories HOT 4
- Announcement!!!
- [CORE API] getTeams() Fails with ApiResponseParsingException: No content to map due to end-of-input at [Source: (String)""; line: 1, column: 0] HOT 4
- GitPullRequest getCommits() is always null HOT 3
- CVE "sonatype-2022-6438" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-devops-java-sdk.