Better approach to do Authorization in shibboleth

Surinaidu Majji pioneer.suri at gmail.com
Fri Dec 5 05:21:47 EST 2014


Hello Peter, Thank you point out my exact need. I think basically we have
the Rest API to get the data from our server(database).

Now we are doing authentication against our database by using the following
code snippet:
I think the below is HTTP url:

                        URL url = new URL("http://ipaddress:port
/module/manager");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "*application/json;*
charset=UTF-8");
OutputStream os = conn.getOutputStream();
os.write(request.getBytes());
os.flush();
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}

BufferedReader br = new BufferedReader(new InputStreamReader(
(conn.getInputStream())));
String output;
StringBuffer sb = new StringBuffer();
while ((output = br.readLine()) != null) {
sb.append(output);
}
return sb.toString();

The above is my 'POST' request along with the username and password as
attributes in the request to get the authentication response from our
database.

In the same way how can i write DataConnector in attribute-resolver.xml
along with the attribute-definition to get the user *Permissions *from our
database and then IDP can released to the SP
to do authorization.

Please respond to this query, is my assumption right?

Thank you in advance,


On Fri, Dec 5, 2014 at 12:05 AM, Peter Schober <peter.schober at univie.ac.at>
wrote:

> * Surinaidu Majji <pioneer.suri at gmail.com> [2014-12-04 12:36]:
> > if i am correct, Like this can we get the permissions of the user, Please
> > give me an example to get the permissions of the user at SP side in saml
> > response.
>
> You get whatever data you need ("the permissions of the user" in your
> case) by configuring the attribute resolver as documented, which out
> of the box supports RDMBSs/JDBC and LDAP.
> >
> > 2)      What data source contains this attribute?
> > - Here the only source is our database for every information, I can get
> the
> > info from database by sending request with proper url.
>
> That's still lacking any necessary technical details. What access
> protocols does that "database" offer? How does the "proper url" look
> like? A HTTP URL? JNDI? Something like "jdbc:oracle:thin:..."?
> For everything other than LDAP or JNDI you'll either have to use
> contributed code (where some exists that matches the
> interfaces/protocols you have available) or write code yourself.
>
> > Please provide me some example with xml configuration, So that i can
> > easily handle my task.
>
> The documentation is full of examples for given protocols/interfaces.
> You're not saying exactly how you need to connect to the "database" of
> yours, you only keep repeating boilerplate code from your
> ExternalAuthn login handler.
> -peter
> --
> To unsubscribe from this list send an email to
> users-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20141205/fb2c2e78/attachment.html 


More information about the users mailing list