~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to docs/tutorial/sp-login-send-authn-request.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <lasso/lasso.h>
 
2
 
 
3
lasso_init();
 
4
 
 
5
/*
 
6
 * Send an authentication request to identity provider.
 
7
 *
 
8
 * Called when the user press login button on service provider.
 
9
 */
 
10
 
 
11
server_dump = [...] /* Load server_dump from file or database or... */
 
12
server = lasso_server_new_from_dump(server_dump);
 
13
g_free(server_dump);
 
14
login = lasso_login_new(server);
 
15
if (lasso_login_init_authn_request(login, "http://identification.entrouvert.org") != 0)
 
16
        [...] /* Handle error. */
 
17
 
 
18
/* Identity provider will ask user to authenticate himself. */
 
19
lasso_lib_authn_request_set_isPassive(login->request, FALSE);
 
20
 
 
21
/* Identity provider will not ask user to authenticate himself if he has already done it recently. */
 
22
/* lasso_lib_authn_request_set_forceAuthn(login->request, FALSE); */
 
23
 
 
24
/* Identity provider will create a federation with this service provider and this user, if this was */
 
25
/* not already done. */
 
26
lasso_lib_authn_request_set_nameIDPolicy(login->request, lassoLibNameIDPolicyTypeFederated);
 
27
 
 
28
if (lasso_login_build_authn_request_msg(login) != 0)
 
29
        [...] /* Handle error. */
 
30
[...] /* Reply a HTTP redirect to login->msg_url. */
 
31
lasso_login_destroy(login);
 
32
lasso_node_destroy(server);
 
33
 
 
34
lasso_shutdown();