equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
32 import com.sun.security.jgss.InquireType; |
32 import com.sun.security.jgss.InquireType; |
33 |
33 |
34 import java.io.IOException; |
34 import java.io.IOException; |
35 import java.util.Arrays; |
35 import java.util.Arrays; |
36 import java.util.HashMap; |
36 import java.util.HashMap; |
37 import java.util.Locale; |
|
38 import javax.security.auth.callback.Callback; |
37 import javax.security.auth.callback.Callback; |
39 import javax.security.auth.callback.CallbackHandler; |
38 import javax.security.auth.callback.CallbackHandler; |
40 import javax.security.auth.callback.UnsupportedCallbackException; |
39 import javax.security.auth.callback.UnsupportedCallbackException; |
41 import javax.security.sasl.*; |
40 import javax.security.sasl.*; |
42 |
41 |
44 public class SaslBasic { |
43 public class SaslBasic { |
45 |
44 |
46 public static void main(String[] args) throws Exception { |
45 public static void main(String[] args) throws Exception { |
47 |
46 |
48 boolean bound = args[0].equals("bound"); |
47 boolean bound = args[0].equals("bound"); |
49 String name = "host." + OneKDC.REALM.toLowerCase(Locale.US); |
48 String name = "host." + OneKDC.REALM_LOWER_CASE; |
50 |
49 |
51 new OneKDC(null).writeJAASConf(); |
50 new OneKDC(null).writeJAASConf(); |
52 System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); |
51 System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); |
53 |
52 |
54 HashMap clntprops = new HashMap(); |
53 HashMap clntprops = new HashMap(); |