You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by co...@apache.org on 2017/06/13 16:29:54 UTC
syncope git commit: Adding an example to show how to obtain a JWT
Token using curl and use it to make an invocation
Repository: syncope
Updated Branches:
refs/heads/master d02729e63 -> 862835641
Adding an example to show how to obtain a JWT Token using curl and use it to make an invocation
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/86283564
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/86283564
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/86283564
Branch: refs/heads/master
Commit: 862835641a986318db2a5c7c6ce1ceccdb9d1296
Parents: d02729e
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Jun 13 17:29:31 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Jun 13 17:29:31 2017 +0100
----------------------------------------------------------------------
.../workingwithapachesyncope/restfulservices.adoc | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/86283564/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
index d52cc8e..d602a61 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
@@ -89,6 +89,23 @@ user.
The same header with provided value must be included in all subsequent requests, in order for the requester to
be checked for authorization.
+For example, using http://curl.haxx.se/[curl^]:
+
+....
+curl -I -u admin:password -X POST \
+ http://localhost:9080/syncope/rest/accessTokens/login
+....
+returns
+....
+HTTP/1.1 204
+X-Syncope-Token: eyJ0e..
+....
+which can then be used to make a call to the REST API
+.....
+curl -I -H "X-Syncope-Token: eyJ0e.." \
+ http://localhost:9080/syncope/rest/users/self
+.....
+
The token duration can be configured via the `jwt.lifetime.minutes` property - see
<<configuration-parameters, below>> for details.