मैं गूगल एपीआई Oauth से यह संदेश मिल रहा हूँ: ग्राहक के लिए मान्य नहीं है मूल:मान्य नहीं है मूल
idpiframe_initialization_failed ", विवरण":। http://127.0.0 ... itelist इस
0: अपनी परियोजना के ग्राहक आईडीमैं इस स्थानीय पथ से एक अनुरोध भेजने के लिए कोशिश कर रहा हूँके लिए मूल
और मैं पहले से ही अधिकृत जावास्क्रिप्ट मूल अनुभाग के लिए इस URL कहा:
यह मेरा कोड है:
<!-- The top of file index.html -->
<html itemscope itemtype="http://schema.org/Article">
<head>
<!-- BEGIN Pre-requisites -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
</script>
<script src="https://apis.google.com/js/client:platform.js?onload=start" async defer>
</script>
<!-- END Pre-requisites -->
<!-- Continuing the <head> section -->
<script>
function start() {
gapi.load('auth2', function() {
auth2 = gapi.auth2.init({
client_id: 'MY CLIENT ID.apps.googleusercontent.com',
// Scopes to request in addition to 'profile' and 'email'
//scope: 'https://www.google.com/m8/feeds/'
});
});
}
</script>
</head>
<body>
<button id="signinButton">Sign in with Google</button>
<script>
$('#signinButton').click(function() {
// signInCallback defined in step 6.
auth2.grantOfflineAccess().then(signInCallback);
});
</script>
<!-- Last part of BODY element in file index.html -->
<script>
function signInCallback(authResult) {
if (authResult['code']) {
// Hide the sign-in button now that the user is authorized, for example:
$('#signinButton').attr('style', 'display: none');
// Send the code to the server
$.ajax({
type: 'POST',
url: 'http://example.com/storeauthcode',
// Always include an `X-Requested-With` header in every AJAX request,
// to protect against CSRF attacks.
headers: {
'X-Requested-With': 'XMLHttpRequest'
},
contentType: 'application/octet-stream; charset=utf-8',
success: function(result) {
// Handle or verify the server response.
},
processData: false,
data: authResult['code']
});
} else {
// There was an error.
}
}
</script>
<!-- ... -->
</body>
</html>
मैं इसे कैसे ठीक कर सकते हैं?
[Google एपीआई प्रमाणीकरण: क्लाइंट के लिए मान्य मूल नहीं] का संभावित डुप्लिकेट (http://stackoverflow.com/questions/42566296/google-api-authentication-not-valid-origin-for-the-client) – DaImTo
मैं अभी एक ही मुद्दे की उम्मीद कर रहा हूं। – Praytic
क्या आप इसे ठीक करने में सक्षम थे? – Praytic