authentification Web Service depuis c#
Bonjour,
je n'arrive pas a ma connecter a mon webservice en mode authentifié.
Mon webservice en fait un EJB du un serveur weblogic.
j'arrive a comuniqué avec via java
Code:
1 2 3 4 5 6 7 8 9 10 11
| ServiceDomaineBeanSecureService service = new ServiceDomaineBeanSecureService();
ServiceDomaineBeanSecure port =service.getServiceDomaineBeanSecurePort();
BindingProvider bp = (BindingProvider) port;
bp.getBinding();
Map<String, Object> ctx = bp.getRequestContext();
ctx.put(BindingProvider.USERNAME_PROPERTY, "utilisateur1");
ctx.put(BindingProvider.PASSWORD_PROPERTY, "utilisateur1");
long retour = port.createDeal(texteUtilisateur); |
par contre via c# pas du tout (j'ai un autre service sans auhtentification avec qui j'arrive bien a communiquer)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| private void cmd_webservice_Click(object sender, EventArgs e)
{
POCWSSECURE.ServiceDomaineBeanSecureClient ws;
long id = 0;
ws = new POCWSSECURE.ServiceDomaineBeanSecureClient();
cred.UserName.UserName = "utilisateur1";
cred.UserName.Password = "utilisateur1";
ws.Open();
id = ws.createDeal("Bruno");
ws.Close();
txt_dealid.Text = id.ToString();
} |
et j'ai une erreur FaultException
detail :
Citation:
[EJB:010160]Security Violation: User: '<anonymous>' has insufficient permission to access EJB: type=<ejb>, application=testWSAnnot, module=testWSAnnot.jar, ejb=ServiceDomaineBeanSecure, method=createDeal, methodInterface=ServiceEndpoint, signature={java.lang.String}.
j'ai essayer avec tous les élément UserNames de mon service
Code:
1 2 3
| cred.HttpDigest.ClientCredential.UserName = "utilisateur1";
cred.HttpDigest.ClientCredential.Password = "utilisateur1";
cred.HttpDigest.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; |
marche pas
Code:
1 2 3
| cred.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
cred.Windows.ClientCredential.UserName = "utilisateur1";
cred.Windows.ClientCredential.Password = "utilisateur1"; |
non plus
je suis dans le flou total