Jump to content
  • 0

Authentication 400 Error


MLaya

Question

Hello!

I am using the HTTP basic authentication method for my mobile app and have followed the POST request as outlined on the website.  My ajax call is as follows:

 

$(document).ready (function () {
     
     $('button').click(function () {
         var Client_ID = $('clientid').val();
         var Client_Secret = $('clientsecret').val(); 
        
        $.ajax ({
            type: 'POST',
            url: 'Token endpoint',
            data: 'grant_type=client_credentials',
            headers: {
                'Authorization' : 'Basic Q2xpZW50X0lEOkNsaWVudF9TZWNyZXQ='
            },
            
            success: function(data) {
                window.location.href = 'page1.html';
            },
        });
     });
     
     

I encoded the string "Client_ID:Client_Secret" as advised too.  Upon checking my network console, I'm getting a 400 error.

Can anyone help?

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...