source: branches/TaskRewrite/src/plugins/acegi-0.5.1/src/groovy/org/codehaus/groovy/grails/plugins/springsecurity/openid/GrailsOpenIdAuthenticationToken.groovy @ 58

Last change on this file since 58 was 58, checked in by gav, 15 years ago

Configure BootStrap? with latest concepts.
Install and setup Acegi plugin with custom views.
Test Fixture plugin in a test app but couldn't get it to work with Acegi encodePassword() so gave up.

File size: 1.7 KB
Line 
1/* Copyright 2006-2009 the original author or authors.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *      http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15package org.codehaus.groovy.grails.plugins.springsecurity.openid
16
17import org.springframework.security.GrantedAuthority
18import org.springframework.security.providers.openid.OpenIDAuthenticationStatus
19import org.springframework.security.providers.openid.OpenIDAuthenticationToken
20import org.springframework.security.userdetails.UserDetails
21
22/**
23 * Subclass that holds the user domain instance.
24 *
25 * @author <a href='mailto:beckwithb@studentsonly.com'>Burt Beckwith</a>
26 */
27class GrailsOpenIdAuthenticationToken extends OpenIDAuthenticationToken {
28
29        private UserDetails _userDetails
30
31        /**
32         * Full constructor.
33         * @param userDetails  the details
34         * @param status  the status
35         * @param identityUrl  the url
36         */
37        GrailsOpenIdAuthenticationToken(
38                        UserDetails userDetails,
39                        OpenIDAuthenticationStatus status,
40                        String identityUrl) {
41                super(userDetails.authorities, status, identityUrl)
42                _userDetails = userDetails
43        }
44
45        /**
46         * {@inheritDoc}
47         * @see org.springframework.security.providers.openid.OpenIDAuthenticationToken#getPrincipal()
48         */
49        @Override
50        Object getPrincipal() {
51                return _userDetails
52        }
53}
Note: See TracBrowser for help on using the repository browser.