Hey Andreas , According to the document The getSubject() call in a standalone application might return a Subject based on user data in an application-specific location
So in my application in which I am using postgres and hibernate.what getsubject will return On Fri, 25 Jan 2019, 09:48 Andreas Reichel <[email protected] wrote: > Hi Sunil. > > You easily can build your own Custom JDBC Realm, taking care of the > particular connection settings. > I found that much easier then to fidle with the generic JDBC realm. > > For reference, see my own realm attached, you will need to implement at > least the highlighted parts: > > /** > * This implementation of the interface expects the principals > collection to return a String > * username keyed off of this realm's {@link #getName() name} > * > * @see > #getAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection) > */ > @Override > protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection > principals) { > > // null usernames are invalid > if (principals == null) { > throw new AuthorizationException("PrincipalCollection method > argument cannot be null."); > } > > String username = (String) getAvailablePrincipal(principals); > > Connection conn = null; > Set<String> roleNames = null; > Set<String> permissions = null; > try { > conn = *COMMONReader.etlConnection.getConnection();* > > // Retrieve roles and permissions from database > roleNames = getRoleNamesForUser(conn, username); > if (permissionsLookupEnabled) { > permissions = getPermissions(conn, username, roleNames); > } > > } catch (Exception e) { > throw new AuthorizationException( > "There was a SQL error while authorizing user [" + username + > "]", e); > } finally { > COMMONReader.etlConnection.release(conn); > } > > SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleNames); > info.setStringPermissions(permissions); > return info; > > } > > > Best regards > Andreas > > On Thu, 2019-01-24 at 21:00 -0700, Sunil kumar wrote: > > org.apache.shiro.config.ConfigurationException: Property 'serverName' does > > not exist for object of type > > com.orientechnologies.orient.jdbc.OrientJdbcDriver. > > at > > org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:413) > > > > > This is the error I'm getting when I use this configuration. > > I don't have a clear understanding of how to connect to orientdb using jdbc > > realm > > > > > -- > > Sent from: > > http://shiro-user.582556.n2.nabble.com/ > > > >
