Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-2011, 04:11 PM
arw arw is offline
Active Member
 
Posts: 25
Default SOAP auth against AuthProvider

Hey,

I've created an AuthProvider implementation to use our authentication system.

It's more or less working, I largely copied the ZimbraAuthProvider implementation and changed as necessary...

I've hit a problem though: trying to auth through SOAP using our customer provider.

I'm basing my tests on this article: » Zimbra :: Blog -- specifically the part:
<authToken type='SAML_AUTH_PROVIDER'>b07b804c-7c29-ea16-7300-4f3d6f7928ac</authToken>

... I have constructed a SOAP auth request that looks like this using the LmcSoapRequest classes:
<AuthRequest xmlns="urn:zimbraAccount"><authToken type="OUR_AUTH_PROVIDER">xxxTokenFromOurAuthSystem </authToken></AuthRequest>

Our AuthProvider implementation checks with our signon system and validates the supplied token.

However all the logging indicates that even though I am specifying our custom AuthProvider impl in the <authToken> type as per the blog article it is never being called ...

If anyone has any insights they would be appreciated, maybe I'm just missing something simple?
Reply With Quote
  #2 (permalink)  
Old 03-10-2011, 08:11 AM
arw arw is offline
Active Member
 
Posts: 25
Default

Will post a follow up infos ...

Have done some packet inspecting and the big difference I can see is that the auth-token im sending is in the soap:body rather than the soap:header as in the example ... will investigate to see if I can get this element in the header using the Lmc* classes ... or if it at leasts works if I make a raw request with it in the header.
Reply With Quote
  #3 (permalink)  
Old 03-10-2011, 09:15 AM
arw arw is offline
Active Member
 
Posts: 25
Default

No luck just using raw posts to the soap api either ...

Below is a request that DOES work, using the standard auth token:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>...long-ass-zimbra-auth-token...</authToken>
</context>
</soap:Header>
<soap:Body>
<GetFolderRequest xmlns="urn:zimbraMail"/>
</soap:Body>
</soap:Envelope>

Now the request trying to use our custom AuthProvider impl:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken type="CUSTOM_AUTH_PROVIDER">abc-custom-authsystem-token-xyz</authToken>
</context>
</soap:Header>
<soap:Body>
<GetFolderRequest xmlns="urn:zimbraMail"/>
</soap:Body>
</soap:Envelope>

This generates a 500 response:
Code:service.AUTH_REQUIRED
at com.zimbra.common.service.ServiceException.AUTH_RE QUIRED(ServiceException.java:296)


....
Reply With Quote
  #4 (permalink)  
Old 03-10-2011, 02:21 PM
Project Contributor
 
Posts: 92
Default

Hi arw,


Firtst of all, can we make sure that your auth provider extension is properly loaded?
You can chcek that from mailbox.log. Or you can log some messages in extesion's init() to mailbox.log and check that.

Then if it is there, please check that zimbra_auth_provider setting in localconfig
is properly done.
Reply With Quote
  #5 (permalink)  
Old 03-10-2011, 02:35 PM
arw arw is offline
Active Member
 
Posts: 25
Default

Hi Yutaka,

Yes zmlocalconfig value zimbra_auth_provider is correctly set to 'CUSTOM_AUTH_PROVIDER' and logging indicates the extension is loading properly. Also login calls made form the main web-client login screen (which uses SOAP) can be seen to be calling the custom auth provider.

Thx for reply ... hope you can shed some light!
Reply With Quote
  #6 (permalink)  
Old 03-10-2011, 05:27 PM
Project Contributor
 
Posts: 92
Default

So basically, you said that your auth provider looks to be excuted for every auth request, but it does not look to pick up your own auth token, right?

Hmm...

Can we see your auth provider source code?
Reply With Quote
  #7 (permalink)  
Old 03-11-2011, 06:57 AM
arw arw is offline
Active Member
 
Posts: 25
Default

It's called by the main login web interface which makes a soap call to the api.

It is not called when I make a direct soap request as detailed in the blog entry, specifying my AuthProvider in the authToken 'type' attribute.

I will try to post the source code a bit later but it is basically a carbon copy of ZimbraAuthProvider except I added an additional POST call to our SSO system to verify the token.
Reply With Quote
  #8 (permalink)  
Old 03-13-2011, 09:39 PM
Zimbra Employee
 
Posts: 70
Default

Looks like your auth provider implementation is working only when auth cookie is present. Can you check your implementation of the authToken(Element soapCtxt, Map engineCtxt) method since that's the method that looks up the token inside the soap header context.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.