FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/java/ql/src/Security/CWE/CWE-522/LdapAuthUseLdaps.java at main · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
478
(478)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Security
/
CWE
/
CWE-522
/
LdapAuthUseLdaps.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
10 lines (10 loc) · 576 Bytes
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Security
/
CWE
/
CWE-522
/
LdapAuthUseLdaps.java
Copy path
File metadata and controls
10 lines (10 loc) · 576 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
// GOOD: LDAP connection using LDAPS
String
ldapUrl
=
"ldaps://ad.your-server.com:636"
;
Hashtable
<
String
,
String
>
environment
=
new
Hashtable
<
String
,
String
>();
environment
.
put
(
Context
.
INITIAL_CONTEXT_FACTORY
,
"com.sun.jndi.ldap.LdapCtxFactory"
);
environment
.
put
(
Context
.
PROVIDER_URL
,
ldapUrl
);
environment
.
put
(
Context
.
REFERRAL
,
"follow"
);
environment
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
environment
.
put
(
Context
.
SECURITY_PRINCIPAL
,
ldapUserName
);
environment
.
put
(
Context
.
SECURITY_CREDENTIALS
,
password
);
DirContext
dirContext
=
new
InitialDirContext
(
environment
);
Back
|
FazBrowse Home
|
New Git URL