1
#include <lasso/lasso.h>
6
* Send an authentication request to identity provider.
8
* Called when the user press login button on service provider.
11
server_dump = [...] /* Load server_dump from file or database or... */
12
server = lasso_server_new_from_dump(server_dump);
14
login = lasso_login_new(server);
15
if (lasso_login_init_authn_request(login, "http://identification.entrouvert.org") != 0)
16
[...] /* Handle error. */
18
/* Identity provider will ask user to authenticate himself. */
19
lasso_lib_authn_request_set_isPassive(login->request, FALSE);
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); */
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);
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);