Problem with oAuth2.0 Authentication in Web API

Certified Lead Developer

Hi All,

I have created a Web API.

I tried with

1. Basic Auth by providing username and password. - Worked

2. Using API Key - Worked

      - Created New API Key with service account and copied API Key

      - Created a group in my application and added the service account in that group

      - Provided viewer access to Web API 

      - Accessed Web API by passing  Appian-API-Key: <API Key Value> in Header

3. Using Appian OAuth 2.0 Clients - Authentication is Successful but getting empty data

      - Created New API Key with service account and copied Client Id, Client Secret, Token Request End Point

     - Created a group in my application and added the service account in that group

      - Provided viewer access to Web API 

      - Accessed Web API by passing the values like below

I tried using post man also working for both Basic Auth and API Key. But not working for OAuth2. Below is the screenshot. 

Kindly suggest the solution.

Please Let me know If you need other details for helping me.

Thanks in Advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    It seems like you've successfully authenticated using Basic Auth and API Key but are encountering issues with OAuth2. If authentication is successful but you're getting empty data, it might be a problem with authorization or how you're accessing the data after authentication. Double-check your OAuth2 configuration, including scopes and permissions, to ensure the client has the necessary access to retrieve the data. Additionally, verify that the API endpoints you're trying to access are correctly configured to return data for authenticated clients.

  • 0
    Certified Lead Developer
    in reply to Shubham Aware

    Hi Shubham,

    Thanks for the response.

    I found the issue. By default, service accounts are created as Basic User. If I update them as Administrator, I'm getting the data.

    Is that correct way or do we have some other way to do it? 

Reply Children