<commit_before>WebID Login
===========

WebID login widget using Web Components.

Runing live here: http://linkeddata.github.io/webid-login/

Quick Start for contributors
----------------------------

```
$ git clone git://github.com/linkeddata/webid-login
$ cd webid-login
$ sudo npm -g install bower
$ bower install
```

Using the component
-------------------

To use this particular component, you only need to include the minified version of the webcomponents script together with the corresponding component code, and then use the html tag in your page. Here is an example (replace with the actual version of the webcomponents.js script, e.g. 0.5.2):

```
<html>
<head>
	<script src="//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/<version>/webcomponents.min.js"></script>
	<link rel="import" href="bower_compoments/webid-login/webid-login.html">
</head>
<body>
	<webid-login></webid-login>
</body>
</html>
```

The login component currently authenticates users through WebID-TLS. Once the authentication has been performed, a CustomEvent function is used to trigger and propagate the auth outcome to the parent window. Here is the structure of the *WebIDAuth* event object:

```
WebIDAuth : { details: { 
						auth: string, // type of auth method (i.e. WebID-TLS)
						success: bool, // true if auth was successful
						user: string // the WebID of the user
					}
			}
```


To listen to the event, one can add a very simple event listener in the document that uses the login component (replace with the actual version of the webcomponents.js script, e.g. 0.5.2):

```
<html>
<head>
	<script src="//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/<version>/webcomponents.min.js"></script>
	<link rel="import" href="webid-login.html">
</head>
<body>
	<webid-login></webid-login>
	<script>
		// Listen to WebIDAuth events
		window.addEventListener('WebIDAuth',function(e) {
			console.log(e.detail);
			if (e.detail.success === true) {
				console.log("Auth successful! WebID: "+e.detail.user);
			} else {
				console.log("Auth failed!");
				console.log(e.detail);
			}
		},false);<commit_msg>Fixed example link<commit_after>WebID Login
===========

WebID login widget using Web Components.

Runing live here: http://linkeddata.github.io/webid-login/

Quick Start for contributors
----------------------------

```
$ git clone git://github.com/linkeddata/webid-login
$ cd webid-login
$ sudo npm -g install bower
$ bower install
```

Using the component
-------------------

To use this particular component, you only need to include the minified version of the webcomponents script together with the corresponding component code, and then use the html tag in your page. Here is an example (replace with the actual version of the webcomponents.js script, e.g. 0.5.2):

```
<html>
<head>
	<script src="//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/<version>/webcomponents.min.js"></script>
	<link rel="import" href="bower_compoments/webid-login/webid-login.html">
</head>
<body>
	<webid-login></webid-login>
</body>
</html>
```

The login component currently authenticates users through WebID-TLS. Once the authentication has been performed, a CustomEvent function is used to trigger and propagate the auth outcome to the parent window. Here is the structure of the *WebIDAuth* event object:

```
WebIDAuth : { details: { 
						auth: string, // type of auth method (i.e. WebID-TLS)
						success: bool, // true if auth was successful
						user: string // the WebID of the user
					}
			}
```


To listen to the event, one can add a very simple event listener in the document that uses the login component (replace with the actual version of the webcomponents.js script, e.g. 0.5.2):

```
<html>
<head>
	<script src="//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/<version>/webcomponents.min.js"></script>
	<link rel="import" href="bower_components/webid-login/webid-login.html">
</head>
<body>
	<webid-login></webid-login>
	<script>
		// Listen to WebIDAuth events
		window.addEventListener('WebIDAuth',function(e) {
			console.log(e.detail);
			if (e.detail.success === true) {
				console.log("Auth successful! WebID: "+e.detail.user);
			} else {
				console.log("Auth failed!");
				console.log(e.detail);
			}
		},false);
{'fraction_non_alphanumeric': 0.1486804901036758, 'fraction_numerical': 0.002827521206409048, 'mean_word_length': 3.60412147505423, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3643430', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1274, 'n_words': 429}