Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is hash fragment referring to in the following text?

In the following post they use the term hash fragment. I am not quite sure what they mean by that. Are they referring to the text after a hash in a url?

e.g. www.someurl.com#somefragment

The blurb I am looking at in the article is below

In the implicit flow the access token is passed directly as a hash fragment (not as a URL parameter). One important thing about hash fragment is that, once you follow a link containing a hash fragment, only the browser is aware of the hash fragment. Browsers will pass the hash fragment directly to the destination webpage (the redirect URI / the client's webpage). Hash fragment have the following properties:

like image 514
Ryan-Neal Mes Avatar asked Dec 23 '16 09:12

Ryan-Neal Mes


People also ask

What are hash fragments?

A hash sign (#) in a URL is referred to as a fragment. Historically, URL fragments have been used to automatically set the browser's scroll position to a predefined location in the web page. In that sense, if a URL refers to a document, then the fragment refers to a specific subsection of that document.

What does a hash mean in a URL?

In a URL, a hash mark, number sign, or pound sign ( # ) points a browser to a specific spot in a page or website. It is used to separate the URI of an object from a fragment identifier.

Which part of the URL is called the fragment or hash?

The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document.

What are fragments in a URL?

A fragment is an internal page reference, sometimes called a named anchor. It usually appears at the end of a URL and begins with a hash (#) character followed by an identifier. It refers to a section within a web page. In HTML documents, the browser looks for an anchor tag with a name attribute matching the fragment.


1 Answers

Yes, you're correct. They refer to the URL part after the # character.

In example.com#state=dJfw&access_token=lkTyd234AsdF the hash fragment (fragment component) would be:

state=dJfw&access_token=lkTyd234AsdF

This is used by the OAuth2 implicit grant to deliver the response data. In the specification, the terminology used is either fragment component or fragment.

In contrast, the authorization code grant would deliver the information in the query part of the URL, example.com?state=asdTwe3SD&code=kjh56Sdgv.

like image 195
João Angelo Avatar answered Sep 17 '22 21:09

João Angelo