# Postman encode different base64 then Java

**URL:** <https://community.postman.com/t/postman-encode-different-base64-then-java/2816>\
**Category:** Help Hub\
**Created:** [September 28, 2018, 12:12pm UTC](https://community.postman.com/t/postman-encode-different-base64-then-java/2816 "2018-09-28T12:12:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkawczynski07](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@mkawczynski07](https://community.postman.com/u/mkawczynski07)\
**Post date:** [September 28, 2018, 12:12pm UTC](https://community.postman.com/t/postman-encode-different-base64-then-java/2816/1 "2018-09-28T12:12:35Z")

</div>

I use oauth2 with the postman. I defined secret and client. And all the time I get “Unauthorized”. So I checked what is wrong on the server side. I figured up that Postman sends different Base64 the I generate with java.

```
String authorization = clientId + ":" + clientSecret;
return "Basic " + Base64Utils.encodeToString(authorization.getBytes(StandardCharsets.UTF_8));

```

And for: clientId=web-app and clientSecret=changeit  
Postman generate: d2ViLWFwcDpjaGFuZ2VpdA==  
Java generate : d2ViX2FwcDpjaGFuZ2VpdA==

I use java 10, Postman: v6.3.0 on ubuntu 18.04 lts.

So where is the problem?🙂 Any hints?

Edit.  
No question… I send **web-app** but in configuration I have **web\_app** 😮

---

<div class="post-metadata">

**Author:** ![JohnDNC](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@JohnDNC](https://community.postman.com/u/JohnDNC)\
**Post date:** [July 20, 2019, 9:21am UTC](https://community.postman.com/t/postman-encode-different-base64-then-java/2816/2 "2019-07-20T09:21:25Z")

</div>

I believe I have the same issue. I am trying to decode a base64 string that was created with and can be successfully decoded using java.util.Base64.getMimeDecoder().decode(data). None of the Postman script examples (such as atob()) base64 decode correctly.

A different post reports fixed in Canary. [https://www.getpostman.com/downloads/canary](https://www.getpostman.com/downloads/canary)
