Massive package refactoring
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / KeyringLoginModule.java
index 09fece03aa560fb9e6e350b2ae811b3e47b40e1e..ebab12f2cc4cd24149787663aa52dad44c651961 100644 (file)
@@ -1,21 +1,5 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.argeo.cms.auth;
 
-import java.security.AccessController;
 import java.util.Map;
 import java.util.Set;
 
@@ -30,8 +14,9 @@ import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
-import org.argeo.node.security.PBEKeySpecCallback;
-import org.argeo.util.PasswordEncryption;
+import org.argeo.api.cms.keyring.PBEKeySpecCallback;
+import org.argeo.cms.util.CurrentSubject;
+import org.argeo.cms.util.PasswordEncryption;
 
 /** Adds a secret key to the private credentials */
 public class KeyringLoginModule implements LoginModule {
@@ -43,7 +28,7 @@ public class KeyringLoginModule implements LoginModule {
                        Map<String, ?> options) {
                this.subject = subject;
                if (subject == null) {
-                       subject = Subject.getSubject(AccessController.getContext());
+                       this.subject = CurrentSubject.current();
                }
                this.callbackHandler = callbackHandler;
        }