Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 38F7B200B51 for ; Mon, 1 Aug 2016 18:53:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37D04160ACE; Mon, 1 Aug 2016 16:53:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 27A8C160AB2 for ; Mon, 1 Aug 2016 18:53:38 +0200 (CEST) Received: (qmail 96105 invoked by uid 500); 1 Aug 2016 16:53:37 -0000 Mailing-List: contact commits-help@usergrid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@usergrid.apache.org Delivered-To: mailing list commits@usergrid.apache.org Received: (qmail 95758 invoked by uid 99); 1 Aug 2016 16:53:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2016 16:53:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AA583E0B40; Mon, 1 Aug 2016 16:53:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mrusso@apache.org To: commits@usergrid.apache.org Date: Mon, 01 Aug 2016 16:53:37 -0000 Message-Id: <7ea970629a46449488a6a9315e04fd00@git.apache.org> In-Reply-To: <5bb816fa9ec14f87a7a46cab47f2ff30@git.apache.org> References: <5bb816fa9ec14f87a7a46cab47f2ff30@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/50] [abbrv] usergrid git commit: Add license header to new files. archived-at: Mon, 01 Aug 2016 16:53:39 -0000 Add license header to new files. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/71cbd8e5 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/71cbd8e5 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/71cbd8e5 Branch: refs/heads/master Commit: 71cbd8e59499ea18c91c2fbaf3343d82652bb116 Parents: 6c36882 Author: Michael Russo Authored: Fri Jun 24 17:14:20 2016 -0700 Committer: Michael Russo Committed: Fri Jun 24 17:14:20 2016 -0700 ---------------------------------------------------------------------- .../cassandra/ManagementServiceImpl.java | 7 +++++++ .../usergrid/security/sso/ApigeeSSO2Provider.java | 16 ++++++++++++++++ .../usergrid/security/sso/ExternalSSOProvider.java | 16 ++++++++++++++++ .../usergrid/security/sso/SSOProviderFactory.java | 17 ++++++++++++++++- .../security/sso/UsergridExternalProvider.java | 16 ++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/71cbd8e5/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java index b56f211..b062f84 100644 --- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java +++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java @@ -68,6 +68,7 @@ import org.apache.usergrid.security.shiro.utils.SubjectUtils; import org.apache.usergrid.security.tokens.TokenCategory; import org.apache.usergrid.security.tokens.TokenInfo; import org.apache.usergrid.security.tokens.TokenService; +import org.apache.usergrid.security.tokens.cassandra.TokenServiceImpl; import org.apache.usergrid.security.tokens.exceptions.TokenException; import org.apache.usergrid.services.*; import org.apache.usergrid.utils.*; @@ -1525,6 +1526,12 @@ public class ManagementServiceImpl implements ManagementService { @Override public String getAccessTokenForAdminUser( UUID userId, long duration ) throws Exception { + + if( properties.getProperty(TokenServiceImpl.USERGRID_EXTERNAL_SSO_ENABLED).equalsIgnoreCase("true")){ + throw new RuntimeException("SSO Integration is enabled, Admin users must login via provider: "+ + properties.getProperty(TokenServiceImpl.USERGRID_EXTERNAL_PROVIDER)); + } + return getTokenForPrincipal( ACCESS, null, smf.getManagementAppId(), ADMIN_USER, userId, duration ); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/71cbd8e5/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java b/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java index 5400212..f35e546 100644 --- a/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java +++ b/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.usergrid.security.sso; import io.jsonwebtoken.*; http://git-wip-us.apache.org/repos/asf/usergrid/blob/71cbd8e5/stack/services/src/main/java/org/apache/usergrid/security/sso/ExternalSSOProvider.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/security/sso/ExternalSSOProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/sso/ExternalSSOProvider.java index eee46c6..180a675 100644 --- a/stack/services/src/main/java/org/apache/usergrid/security/sso/ExternalSSOProvider.java +++ b/stack/services/src/main/java/org/apache/usergrid/security/sso/ExternalSSOProvider.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.usergrid.security.sso; import org.apache.usergrid.management.UserInfo; http://git-wip-us.apache.org/repos/asf/usergrid/blob/71cbd8e5/stack/services/src/main/java/org/apache/usergrid/security/sso/SSOProviderFactory.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/security/sso/SSOProviderFactory.java b/stack/services/src/main/java/org/apache/usergrid/security/sso/SSOProviderFactory.java index fae0f7f..a3016c8 100644 --- a/stack/services/src/main/java/org/apache/usergrid/security/sso/SSOProviderFactory.java +++ b/stack/services/src/main/java/org/apache/usergrid/security/sso/SSOProviderFactory.java @@ -1,7 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.usergrid.security.sso; import org.apache.usergrid.corepersistence.CpEntityManagerFactory; -import org.apache.usergrid.management.ManagementService; import org.apache.usergrid.persistence.EntityManagerFactory; import org.apache.usergrid.security.tokens.cassandra.TokenServiceImpl; import org.springframework.beans.factory.annotation.Autowired; http://git-wip-us.apache.org/repos/asf/usergrid/blob/71cbd8e5/stack/services/src/main/java/org/apache/usergrid/security/sso/UsergridExternalProvider.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/security/sso/UsergridExternalProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/sso/UsergridExternalProvider.java index a8d250d..a2e5fb2 100644 --- a/stack/services/src/main/java/org/apache/usergrid/security/sso/UsergridExternalProvider.java +++ b/stack/services/src/main/java/org/apache/usergrid/security/sso/UsergridExternalProvider.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.usergrid.security.sso; import com.codahale.metrics.Counter;