How to use App Access Token to update Open Graph Tags
up vote
0
down vote
favorite
I want to dynamically update Open Graphs Tags on my website, but don't know how to do it properly.
I have understood you're not supposed to use the access token in a client side script, but how do I go about and update it otherwise.
I have seen examples online that does not use an access token, but I get an authorization error then.
Can I make any settings on facebook developer to skip access token or how can I make a call from my javascript, without showing the access token or app secret?
This is the part of my script which runs after modifying the meta:og tags:
//Update Open Graph
$.post(
'https://graph.facebook.com',
{
access_token: '123',
id: strCurrentUrl,
scrape: true
},
function(response){
console.log(response);
}
From Facebook:
for security, app access token should never be hard-coded into
client-side code, doing so would give everyone who loaded your webpage
or decompiled your app full access to your app secret, and therefore
the ability to modify your app. This implies that most of the time,
you will be using app access tokens only in server to server calls.
javascript jquery facebook-graph-api
add a comment |
up vote
0
down vote
favorite
I want to dynamically update Open Graphs Tags on my website, but don't know how to do it properly.
I have understood you're not supposed to use the access token in a client side script, but how do I go about and update it otherwise.
I have seen examples online that does not use an access token, but I get an authorization error then.
Can I make any settings on facebook developer to skip access token or how can I make a call from my javascript, without showing the access token or app secret?
This is the part of my script which runs after modifying the meta:og tags:
//Update Open Graph
$.post(
'https://graph.facebook.com',
{
access_token: '123',
id: strCurrentUrl,
scrape: true
},
function(response){
console.log(response);
}
From Facebook:
for security, app access token should never be hard-coded into
client-side code, doing so would give everyone who loaded your webpage
or decompiled your app full access to your app secret, and therefore
the ability to modify your app. This implies that most of the time,
you will be using app access tokens only in server to server calls.
javascript jquery facebook-graph-api
1
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to dynamically update Open Graphs Tags on my website, but don't know how to do it properly.
I have understood you're not supposed to use the access token in a client side script, but how do I go about and update it otherwise.
I have seen examples online that does not use an access token, but I get an authorization error then.
Can I make any settings on facebook developer to skip access token or how can I make a call from my javascript, without showing the access token or app secret?
This is the part of my script which runs after modifying the meta:og tags:
//Update Open Graph
$.post(
'https://graph.facebook.com',
{
access_token: '123',
id: strCurrentUrl,
scrape: true
},
function(response){
console.log(response);
}
From Facebook:
for security, app access token should never be hard-coded into
client-side code, doing so would give everyone who loaded your webpage
or decompiled your app full access to your app secret, and therefore
the ability to modify your app. This implies that most of the time,
you will be using app access tokens only in server to server calls.
javascript jquery facebook-graph-api
I want to dynamically update Open Graphs Tags on my website, but don't know how to do it properly.
I have understood you're not supposed to use the access token in a client side script, but how do I go about and update it otherwise.
I have seen examples online that does not use an access token, but I get an authorization error then.
Can I make any settings on facebook developer to skip access token or how can I make a call from my javascript, without showing the access token or app secret?
This is the part of my script which runs after modifying the meta:og tags:
//Update Open Graph
$.post(
'https://graph.facebook.com',
{
access_token: '123',
id: strCurrentUrl,
scrape: true
},
function(response){
console.log(response);
}
From Facebook:
for security, app access token should never be hard-coded into
client-side code, doing so would give everyone who loaded your webpage
or decompiled your app full access to your app secret, and therefore
the ability to modify your app. This implies that most of the time,
you will be using app access tokens only in server to server calls.
javascript jquery facebook-graph-api
javascript jquery facebook-graph-api
asked Nov 7 at 20:47
Petter
81
81
1
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18
add a comment |
1
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18
1
1
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197567%2fhow-to-use-app-access-token-to-update-open-graph-tags%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
you should not update them anyway, after a while they even get locked. open graph tags should not change at all in general.
– luschn
Nov 7 at 22:10
what is best practice then for sharing content that is loaded after page load, and therefore cannot be in the meta tags from page load?
– Petter
Nov 8 at 9:09
you HAVE to provide them in the initial html, without javascript. it is always possible, just do stuff server side instead.
– luschn
Nov 8 at 9:21
how can I load them in the initial html when the content is loaded after the page load?
– Petter
Nov 8 at 9:31
what´s the content? you need to be more specific. what exactly are you doing right now?
– luschn
Nov 8 at 11:18