# Postman doesn't return an access\_token in response

**URL:** <https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505>\
**Category:** Help Hub\
**Tags:** authentication, oauth2-token\
**Created:** [January 12, 2024, 10:14am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505 "2024-01-12T10:14:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilianetop](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lilianetop/32/27098_2.png) [@lilianetop](https://community.postman.com/u/lilianetop)\
**Post date:** [January 12, 2024, 10:14am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/1 "2024-01-12T10:14:09Z")

</div>

Setting up an authorization server with spring 6. Trying to create a new access token through postman. It doesn’t return an access token in the response. Credentials, url etc all is fine.  
What am I missing?

 ![Screenshot 2024-01-11 at 17.30.59](https://us1.discourse-cdn.com/getpostman/original/3X/3/4/34478559eccd176233a66144ee24d48730fa127e.png)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [January 12, 2024, 10:17am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/2 "2024-01-12T10:17:42Z")

</div>

Hey @lilianetop 👋

Welcome to the Postman Community! :postman:

That looks like it’s returning a sign in HTML page, are you sure you have it set up correctly or your using the correct credentials.

---

<div class="post-metadata">

**Author:** ![lilianetop](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lilianetop/32/27098_2.png) [@lilianetop](https://community.postman.com/u/lilianetop)\
**Post date:** [January 12, 2024, 10:26am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/3 "2024-01-12T10:26:21Z")

</div>

Yes I am. I am doing this course spring-framework-6 from beginner to guru from John Thompson and this module is setting up an authorization server. I am using this documentation for setting it up: [Getting Started :: Spring Authorization Server](https://docs.spring.io/spring-authorization-server/reference/getting-started.html)

---

<div class="post-metadata">

**Author:** ![lilianetop](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lilianetop/32/27098_2.png) [@lilianetop](https://community.postman.com/u/lilianetop)\
**Post date:** [January 12, 2024, 10:30am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/4 "2024-01-12T10:30:13Z")

</div>

@danny-dainton  
This is the bean I am creating 🙂

```auto
@Bean
  public RegisteredClientRepository registeredClientRepository() {
    RegisteredClient oidcClient = RegisteredClient.withId(UUID.randomUUID().toString())
        .clientId("oidc-client")
        .clientSecret("secret")//usually you encrypt this secret and store it safe
        .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
        .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
        .authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN)
        .redirectUri("http://127.0.0.1:8080/login/oauth2/code/oidc-client")
        .postLogoutRedirectUri("http://127.0.0.1:8080/")
        .scope(OidcScopes.OPENID)
        .scope(OidcScopes.PROFILE)
        .scope("message.read")
        .scope("message.write")
        .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build())
        .build();

    return new InMemoryRegisteredClientRepository(oidcClient);
  }

```

and in Postman this is how I use these credentials to create an access token

 ![Screenshot 2024-01-12 at 11.30.04](https://us1.discourse-cdn.com/getpostman/original/3X/9/9/99771dfe00526f1d21f1cfdde7e622e0b6655761.png)

and in application.properties file I set the server to port 9000

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [January 12, 2024, 10:40am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/5 "2024-01-12T10:40:19Z")

</div>

I’m going to lie, that means very little to me. 😬 I don’t know what that course is or anything about that programming language. I wouldn’t be able to debug anything for you here.

I can’t even seen within that code, how it’s going to return an access token as a response but that might be just my misunderstanding of that framework.

I can just see that from your initial screenshot, whatever you have done/implemented, it’s returning a sign page and not a known structure that contains an _access\_token_.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/9/d9e70d08fe312f70809bf46ce7407712f8ad3c84.png)

---

<div class="post-metadata">

**Author:** ![lilianetop](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lilianetop/32/27098_2.png) [@lilianetop](https://community.postman.com/u/lilianetop)\
**Post date:** [January 12, 2024, 10:51am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/6 "2024-01-12T10:51:30Z")

</div>

The following should be returned. I guess all the information I provided is actual not the issue. Something has changed within Postman which no longer allows to return an access token and I am looking for a way to solve this.

 ![Screenshot 2024-01-12 at 11.49.53](https://us1.discourse-cdn.com/getpostman/original/3X/9/f/9f40f44fd5caa4ddeeeadcc6efeed9a5e5b50dec.jpeg)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [January 12, 2024, 11:06am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/7 "2024-01-12T11:06:43Z")

</div>

I don’t know where that screenshot is from or what details that they have used to get to that point or the version that they were using for that. I also don’t know their implementation/setup/environment/etc.

I can only tell you what is currently happening for your implementation and that it’s returning some sort of sign in form. In the middle of that text it has a title tag that says “Please sign in” which is probably from some modal or popup when hitting that URL.

I don’t know if that’s something to do with cookies or a browser session or the details that you have used or something completely different.

I have no idea about what that particular flow should be for that training.

---

<div class="post-metadata">

**Author:** ![lilianetop](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lilianetop/32/27098_2.png) [@lilianetop](https://community.postman.com/u/lilianetop)\
**Post date:** [January 12, 2024, 11:13am UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/8 "2024-01-12T11:13:31Z")

</div>

The screenshot is from the course and I should get something similar. Only do do not get an access token in my response. The idea is that the request returns the access token and redirects to login page. That is correct. I am just missing the access token.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 12, 2024, 12:07pm UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/9 "2024-01-12T12:07:47Z")

</div>

You say that “_Something has changed within Postman which no longer allows to return an access token_”.

Does that mean it worked for you at some point??

I doubt this is an issue with Postman per se.

This will be for one of two reasons.

1. The info you are sending is incorrect.
2. The token API code is incorrect.

I don’t think we can help with either of those without knowing much more about the implementation, which means we would have to take the course.

This sounds like a question that would be better posed on a Springboot forum.

Client Credentials is a server to server interaction that usually runs in the background without interaction from a user. So the fact that its returning you the HTML code for a login page is very odd indeed. This would appear to point to an issue with the info you are sending\grant type or the token API itself.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [February 11, 2024, 12:07pm UTC](https://community.postman.com/t/postman-doesnt-return-an-access-token-in-response/56505/10 "2024-02-11T12:07:55Z")

</div>

Closed on February 11, 2024, 12:07pm UTC

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