+ Reply to Thread
Results 1 to 5 of 5

Add a JSON data connection with bearer token authentication

  1. #1
    Registered User
    Join Date
    08-22-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    7

    Add a JSON data connection with bearer token authentication

    Hello,



    We have a API implemented and it works as follows-

    POST request to authentication endpoint
    http: //localhost:5698/api/services/app/account/authenticate
    with JSON payload as
    { "usernameOrEmailAddress": "admin", "password": "123qwe" }

    It returns a token which must be used in headers for all further requests. The format of response is as follows-
    { "result": "RETRIEVED_TOKEN", "success": true, "error": null, "unAuthorizedRequest": false }

    We have an endpoint to get a list of all users.
    POST request to endopoint
    http: //localhost:5698/api/services/app/user/GetAllUsers
    With following headers
    Authorization- Bearer RETRIEVED_TOKEN
    Content-Type- application/json
    This returns the JSON results as




    {

    "result": {

    "items": [

    {

    "name": "admin",

    "surname": "admin",

    "lastLoginTime": "2018-12-10T03:01:19.577Z",

    "isActive": true,

    "creationTime": "2018-10-08T10:50:00.557Z",

    "id": 2

    },

    {

    "name": "sso",

    "surname": "sso",

    "lastLoginTime": "2018-10-09T16:42:27.523Z",

    "isActive": true,

    "creationTime": "2018-10-09T05:53:10.697Z",

    "id": 15

    }

    ]

    },

    "success": true,

    "error": null,

    "unAuthorizedRequest": false,

    }



    Question:



    In Excel, I want to create a data connection that will authenticate to this API, retrieve token and use that token to make further request to get all data. That data should be populated as a table.
    Very Important: Users should be able to use Excel's Refresh button to get latest data from service.



    It would be a plus if we can prompt user to enter credentials if the authentication fails or somehow allow a user to enter credentials at some place.



    Thanks.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Add a JSON data connection with bearer token authentication

    Which Excel refresh button? Do you mean right clicking on a table and refresh?

    Which version of Excel will your users have? Will they be running 64-bit office (not windows)? Do they have Get and Transform?

    Is this windows only or cross platform?

  3. #3
    Registered User
    Join Date
    08-22-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    7

    Re: Add a JSON data connection with bearer token authentication

    Quote Originally Posted by Kyle123 View Post
    Which Excel refresh button? Do you mean right clicking on a table and refresh?
    Yes.

    Quote Originally Posted by Kyle123 View Post
    Which version of Excel will your users have? Will they be running 64-bit office (not windows)? Do they have Get and Transform?
    Users have 2013 and 2016 64-bit office.
    Get and Transform - yes


    Quote Originally Posted by Kyle123 View Post
    Is this windows only or cross platform?
    Windows only

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Add a JSON data connection with bearer token authentication

    Get & transform wasn’t in 2013 are you saying that they have downloaded and installed the power query addin?

    Bearer tokens typically expire, how are you wanting to deal with that?

  5. #5
    Registered User
    Join Date
    08-22-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    7

    Re: Add a JSON data connection with bearer token authentication

    Quote Originally Posted by Kyle123 View Post
    Get & transform wasn’t in 2013 are you saying that they have downloaded and installed the power query addin?

    Bearer tokens typically expire, how are you wanting to deal with that?
    We can have them install power query if that is the solution.
    Is there anyway to prompt users for credentials if token expired and then regenerate Bearer token?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change pivot table data connection if current connection = x
    By BellyGas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2016, 06:05 AM
  2. Replies: 1
    Last Post: 03-29-2016, 04:29 PM
  3. Change Connection File for a Data Connection
    By manofcheese in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2015, 03:49 PM
  4. Replies: 2
    Last Post: 05-15-2015, 04:12 PM
  5. [SOLVED] Pulling json or csv data from a url
    By Versial in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-10-2012, 04:43 AM
  6. HTTP Authentication for a QueryTable pulling web data
    By Raman325 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2009, 04:04 PM
  7. Excel 2007 data connection not using connection file
    By algilstrap in forum Excel General
    Replies: 0
    Last Post: 06-09-2009, 03:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1