# Java Eve Esi (Help)

**URL:** <https://forums.eveonline.com/t/java-eve-esi-help/376276>\
**Category:** Third Party Developers\
**Created:** [September 9, 2022, 6:43am UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276 "2022-09-09T06:43:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lurderker\_Etgur\_Avuli](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/lurderker_etgur_avuli/32/333983_2.png) [@Lurderker\_Etgur\_Avuli](https://forums.eveonline.com/u/Lurderker_Etgur_Avuli)\
**Post date:** [September 9, 2022, 6:43am UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/1 "2022-09-09T06:43:26Z")

</div>

Hello everyone, I am currently working on a Java-Based program for my corporation but I am having a bit of issues with the SSO Auth. I am currently using the Eve-Esi Api!

I do have my program to were it will actually connect to the Website when I am using Microsoft Edge but it only pulls up a login page! So I decided to change my default browser to Google Chrome and now I am recieving error listed right below.

## Error

```auto
{"error":"invalid_scope","error_description":"The requested 'esi-markets.read_character_orders.v1' scope is not valid."}

```

# Additional Files

# ========================================================

[Main.java](https://pastebin.com/g2JntUDi)

## Consule Log

```auto
"C:\Program Files\Java\jdk-17.0.1\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.2\lib\idea_rt.jar=50385:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\gam3r\Desktop\PetMaster\PetmasterwoMiniMsg\ZCorps-Eve-Esi\target\classes zcorps.eve_esi.Main
https://login.eveonline.com/v2/oauth/authorize/?response_type=code&redirect_uri=eveauth-app://callback/&client_id=ef8b4e82383e4173bb99983165a37c03&scope=esi-markets.read_character_orders.v1&code_challenge=MmQzMzcxYmYtY2ZiYS00NzExLTk1NTEtN2MxOTJhZTgxM2Uy&code_challenge_method=S256&state=aj2nzcr6a9tu2ag

Process finished with exit code 0

```

Any help would be greatly appreciated, Thank you all in advance! I have spent probably 2 days now looking at 3+ yr old tutorials on youtube for PHP, Python and a couple other Languages and to no prevail nothing I have tried seems to help. I understand the languages above aren't Java but I was attempting to "Convert", if that's the right term to use from those languages to Java!

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [September 9, 2022, 9:14am UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/2 "2022-09-09T09:14:24Z")

</div>

1. Did you add the scope to you dev app?
2. Are you url encoding everything that needs to be url encoded?
3. Check [ESI Documentation | esi-docs](https://docs.esi.evetech.net/#sso) to see if you’re doing everything correctly.

I have a java library that handle all the OAuth stuff for you, if you don’t want to do it all yourself:

> **[GitHub - burberius/eve-esi: Java Client for the EVE Swagger Interface (ESI)](https://github.com/burberius/eve-esi)**
>
> Java Client for the EVE Swagger Interface (ESI). Contribute to burberius/eve-esi development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Lurderker\_Etgur\_Avuli](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/lurderker_etgur_avuli/32/333983_2.png) [@Lurderker\_Etgur\_Avuli](https://forums.eveonline.com/u/Lurderker_Etgur_Avuli)\
**Post date:** [September 9, 2022, 9:18pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/3 "2022-09-09T21:18:46Z")

</div>

Thank you I will go ahead and check it out, I have checked out several other libraries with bare to no documentation on how to use it get started etc… I would also like to eventually learn all the basics so that I am not constantly having to rely on other API’s that may go out of date etc. Thank you for the help 😃 Defintly checking it out now!

---

<div class="post-metadata">

**Author:** ![Lurderker\_Etgur\_Avuli](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/lurderker_etgur_avuli/32/333983_2.png) [@Lurderker\_Etgur\_Avuli](https://forums.eveonline.com/u/Lurderker_Etgur_Avuli)\
**Post date:** [September 9, 2022, 9:24pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/4 "2022-09-09T21:24:22Z")

</div>

I would also just like to throw out there I am brand new, No experience once so ever with Eve Esi. I have read all of the github documentation. So with your api when I instantiate a new APIClient what do I do afterwards??? I have seen this API before and honestly it is very bare boned on details for brand new Eve Players to jump straight into and use! I spent 2 hrs fiddling with all the methods of APIBuilder and it didn’t work at all 😕 I probably just did it wrong but who knows.

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [September 10, 2022, 12:40pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/5 "2022-09-10T12:40:39Z")

</div>

Example of how to get an refresh token: [eve-esi/SsoAuthTest.java at master · burberius/eve-esi · GitHub](https://github.com/burberius/eve-esi/blob/master/src/test/java/net/troja/eve/esi/api/auth/SsoAuthTest.java#L182)

You will need one ApiClient per refresh token.  
Refresh token example (untested, but, you should get the idea):

```java

String refreshToken = ""; //You're refresh token from above
String clientID = ""; //You're clientID from https://developers.eveonline.com/applications
String userAgent = ""; //A good user-agent, see https://docs.esi.evetech.net/docs/esi_introduction.html#user-agent

ApiClient apiClient = new ApiClientBuilder().refreshToken(refreshToken).clientID(clientID).userAgent(userAgent).build()
AssetsApi assetsApi = new AssetsApi(apiClient);

final OAuth auth = (OAuth) apiClient.getAuthentication("evesso");
JWT jwt = auth.getJWT();
JWT.Payload payload = jwt.getPayload();
int charaterID = payload.getCharacterID()
int page = 0; //See x-pages example: https://github.com/burberius/eve-esi/blob/master/src/test/java/net/troja/eve/esi/api/MarketApiTest.java#L234
ApiResponse<List<CharacterAssetsResponse>> apiResponse = assetsApi.getCharactersCharacterIdAssetsWithHttpInfo(charaterID, null, null, page, null);

```

---

<div class="post-metadata">

**Author:** ![stefnia\_Freir](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/stefnia_freir/32/390048_2.png) [@stefnia\_Freir](https://forums.eveonline.com/u/stefnia_Freir)\
**Post date:** [September 10, 2022, 9:31pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/6 "2022-09-10T21:31:19Z")

</div>

> **[GitHub - guiguilechat/JCELechat: Eve Online modeling and interaction](https://github.com/guiguilechat/JCELechat/)**
>
> Eve Online modeling and interaction. Contribute to guiguilechat/JCELechat development by creating an account on GitHub.

direct access with cache to data, including connected

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [September 10, 2022, 9:59pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/7 "2022-09-10T21:59:02Z")

</div>

You should make a PR to add that to [Awesome Eve](https://github.com/devfleet/awesome-eve#java)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [December 9, 2022, 9:59pm UTC](https://forums.eveonline.com/t/java-eve-esi-help/376276/8 "2022-12-09T21:59:33Z")

</div>

Closed on December 9, 2022, 9:59pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
