Facebook developer server sided log in error - html

Even though the app id I gave it is correct, and the redirect uri is an absolute one, and it matches the one that is on the app's setting page, when I try to log in to my website through facebook I get the following error:
The redirect_uri URL must be absolute
This is my log in button:
<asp:ImageButton ID="LoginButton" ImageUrl="~/images/login.jpg" PostBackUrl="https://www.facebook.com/dialog/oauth?client_id={481180555313770}&redirect_uri={singular.somee.com}" runat="server" />
Help is appreciated

Remove the curly brackets {} from the client_id and the redirect_uri and add the protocol http or https to the url.
The final url looks like
https://www.facebook.com/dialog/oauth?client_id=481180555313770&redirect_uri=http://singular.somee.com
Now it works for me and Facebook does not show any error.

Related

See HTML response in chrome network

Hello when I send my html page with google chrome I can't see the path in the link Bar Though I use the method get and when I open the network angle I can't find the query request either enter image description here
On the first view is see that your request goes again a html page. Then you will get as response the html. But i suggest you will send some data. Then you have to add in every form element a name selector. Like <input name="username" ...>.
Then you need a endpoint which can handle your request. A HTML side cant do that. You need a serverside endpoint. Like api.php etc.

Django allauth password reset doesn't work when clicking the link from email, but works otherwise

What is supposed to happen:
The request is completely handled by the django-allauth package which is supposed to detect the token, save it to the session, redirect to the 'change your password' page, and finally load the token from the session.
The problem:
The password reset function does not work when clicking the link from the email (Bad Token), but if I copy-paste the link into the url bar or click the href in Inspect Element mode it DOES work.
Note: It also works if
I reload the page after seeing "Bad Token"
I click the link from inside an email app on my mobile device
The error:
When you click the link from your email you make it all the way to the 'change your password' page but you get a "Bad Token" error as no Token was found in the session.
Format of the link emailed to the user:
link text
For clarification, both the href and the safedirecturl work fine if I copy-paste it into the url bar
Conclusion:
So far, these are my only guesses at the cause of the issue:
An external website is referring the user to the page.
The safedirecturl works which seems to contradict this.
The token is not saved in the session in time (race condition?)
This seems unlikely to me since in django-allauth source code I saw that the token is set in the session before the final redirect.
I would greatly appreciate any input as I'm a bit stumped at this point
Since in my django settings I had SESSION_COOKIE_SECURE = True, I had to change SESSION_COOKIE_SAMESITE = 'Strict' to SESSION_COOKIE_SAMESITE = 'Lax'

use a class instead of id in a link

Is it possible to make a link that would normally go to an id:
<a href="http://example.com/page#someid">
instead go to a class:
<a href="http://example.com/page.someclass">
Would the page scroll wildly up and down, trying to reach all the elements with that class, or would it just do nothing?
It would do nothing, except look for a file called "page.someclass" at the server and most probably yield a 404. Please refer to the URL spec because you're wildly confusing CSS selectors with the 'hash' part of the URL.
Why don't just try it?
JS FIDDLE DEMO
If you are using a class als anchor link, your browser tries to open it as url, like in the example named above index.content. Because he is not able to find it, you will receive an 404 not found or 403 forbidden error.

onclick to forward request to other URL

I want to open a page on click of a link. Below is the link.
<a href='#' onClick=window.open('\\122.96.212.765\spread\form\5.0\tx1\NA\show\SPREAD_Show_ _33_PM\index_VIN_Test_ZASF91A.htm','_self') >CLICK HERE</a>.
But when i click the above link 404 error is displayed on the page as the URL is changing as below:
http://localhost:8080/122.96.212.765spreadform%05.SPREAD_Show_ _33_PMindex_VIN_Test_ZASF91A.htm
Please suggest, do i need to add ay extra code so that onclick even will work.
can try changing your \'s to /'s
As Geoff said, changing your backslash characters with forward slashes should solve your issue. I'm going to assume that because you tagged the question with spring and spring-mvc that you are trying to make this request to a Spring controller with a #RequestMapping matching the URL.
Your request is 404'ing because the actual request is being made to the incorrect URL because your backslash characters are causing issues with either parsing the URL, or generating the request URL. Because the request URL is malformed, it isn't getting picked up by your Spring Controller.
Fix your onclick URL and it should work.
The url used in your code,
"\\122.96.212.765\spread\form\5.0\tx1\NA\show\SPREAD_Show_ _33_PM\index_VIN_Test_ZASF91A.htm",
is syntactically incorrect.
The url does not have 'Scheme' part ("http:", "ftp:", etc.) and strange delimiter '\' are used instead of "/".
If valid url line "http://www.cnn.com/" is used, your code will work.
Try following:
<a href="#" onClick=window.open('http://www.cnn.com/','_self') >CLICK HERE</a>

Facebook share URL with get parameters

I'm trying to generate a share URL with get parameters and it's doing some double encoding shenanigans.
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bing.com%2Fsearch%3Fq%3Dkeyword" />
produces an error url while
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bing.com" />
is fine. Anyone have ideas?
Facebook share link needed to be cached on their side. This has since be resolved on facebooks end.