<commit_before>Authorization Server
=====

The Authorization Server project handles the authorization requests. It is based on:

* Spring Security OAuth2 1.0.0.RC3

and provides

* OAuth2 Authorization Code Flow

Build and Deployment
===

To build the authorization-server run

 mvn clean install

in the authorization-server folder.

If you want to run the authorization-server in a embedded tomcat instance run
```sh
 mvn tomcat7:run
```

To deploy the authorization-server into a running Tomcat copy the "authorization-server.war" into the webapp folder in your Tomcat installation.

Configuration
==

Right now every username with the password "<PASSWORD>" gets accepted.

The client credentials are as well hardcoded:
 * client_id=tonr
 * client_secret=secret
 * redirect_uri=http://localhost:8080/oauth2-client/accessToken

This will change very soon.

Usage
===

To get an authorization code call:
```html
 http://localhost:8080/authorization-server/oauth/authorize?client_id=tonr&response_type=code&redirect_uri=http://localhost:8080/oauth2-client/accessToken
```

To get an access_token call:
```sh
 curl --user tonr:secret -X POST -d "code=$CODE&grant_type=authorization_code&redirect_uri=http://localhost:8080/oauth2-client/accessToken" \
 http://localhost:8080/authorization-server/oauth/token
```

The client authentication is done via Basic Access Authentication.

<commit_msg>extended README with resource-server stuff<commit_after>Build and Deployment
===

To build the authorization-server run

 mvn clean install

in the authorization-server folder.

If you want to run the authorization-server in a embedded tomcat instance run
```sh
 mvn tomcat7:run
```

To deploy the authorization-server into a running Tomcat copy the "authorization-server.war" into the webapp folder in your Tomcat installation.



Authorization Server
=====

The Authorization Server project handles the authorization requests. It is based on:

* Spring Security OAuth2 1.0.0.RC3

and provides

* OAuth2 Authorization Code Flow

Configuration
--

Right now every username with the password "<PASSWORD>" gets accepted.

The client credentials are as well hardcoded:
 * client_id=tonr
 * client_secret=secret
 * redirect_uri=http://localhost:8080/oauth2-client/accessToken

This will change very soon.

Usage
--

To get an authorization code call:
```html
 http://localhost:8080/authorization-server/oauth/authorize?client_id=tonr&response_type=code&redirect_uri=http://localhost:8080/oauth2-client/accessToken
```

To get an access_token call:
```sh
 curl --user tonr:secret -X POST -d "code=$CODE&grant_type=authorization_code&redirect_uri=http://localhost:8080/oauth2-client/accessToken" \
 http://localhost:8080/authorization-server/oauth/token
```

The client authentication is done via Basic Access Authentication.

Accessing Resources
==

To get an overview of all known resources call:
```html
 http://localhost:8080/authorization-server/
```

Getting attributes
--

Attributes are secured, so, you need to provide a valid access token.

With 

```html
 http://localhost:8080/authorization-server/secured/attributes?access_token=$YOUR_ACCESS_TOKEN
```

you will get a list of accessible attributes.

If you want to get a single attribute, you need to extend attributes with an id:

```html
 http://localhost:8080/authorization-server/secured/attributes/{id}?access_token=$YOUR_ACCESS_TOKEN
```



{'fraction_non_alphanumeric': 0.09163229228049499, 'fraction_numerical': 0.02121390689451974, 'mean_word_length': 5.206581352833638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '751905', 'n_tokens_mistral': 1045, 'n_tokens_neox': 951, 'n_words': 324}