rangle/koast — pull request #55 by e-schultz (2014-10-16 17:11:57+00:00)
Title: [#80427646] bug (auth) social auth with token maintenance doesn't work

- Add route /auth/token/refresh to refresh a current token
- expects token to be in the header
- Update serialization of user data for token auth data
- Add separate handling for cookie vs token auth for social
- If using social / token authentication - required to specify a new
option under "authentication" in your config, example:

```json
{
"authentication": {
"strategy": "social",
"maintenance": "cookiecd ",
"clientReturnUrl": "http://localhost:8081"
}
}
```

After OAuth completes, it will redirect to the client application passing
a token.

If using koast-angular, this will take care of getting the token, refreshing it
and navigating to the next page.

If you are not using koast-angular, you will need to refresh the token - as the
initial token that is sent has a short duration.

the koast-examples has a demo app called 'koast-todo-social-sessionless'
- Change response of /auth/getAuthUsernameAvailable to be json

```json
{
data: true/false
}
```

koast-angular has been updated to account for this.

- Upate updating of social login/username
- if cookie maintenance, returns user info
- if token maintence, returns user info + new token
- koast-angular has been updated to make use of the newly returned token