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:
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.
Question
MLaya
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 comment
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.