Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 28c3922

Browse files
authored
1.5 release (#210)
* merge in dev
1 parent 663b8bd commit 28c3922

45 files changed

Lines changed: 1933 additions & 712 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
**/test-output/*
77
.idea/
88
/target
9+
*.iml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,29 @@
88
[We provide a full suite of sample applications and documentation on GitHub](https://github.com/Azure-Samples) to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, macOS, Android, and Linux. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect, Graph API, and other awesome features.
99

1010
## Versions
11-
Current version - 1.4.0
11+
Current version - 1.5.0
1212

13-
Minimum recommended version - 1.4.0
13+
Minimum recommended version - 1.5.0
1414

1515
From version 1.3.0 support for handling Conditional Access claims challenge was added. You can read about CA [here](https://go.microsoft.com/fwlink/?linkid=855860) and refer this [sample](https://github.com/AzureAD/azure-activedirectory-library-for-java/tree/dev/src/samples/web-app-samples-for-adal4j) to handle it.
1616

1717
You can find the changes for each version in the [change log](https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/master/changelog.txt).
1818

19+
## Logging
20+
21+
ADAL for Java uses the Simple Logging Facade for Java (SLF4J) as a simple facade or abstraction for various logging frameworks.
22+
23+
#### Personal Identifiable Information (PII) & Organizational Identifiable Information (OII)
24+
25+
By default, ADAL logging does not capture or log any PII or OII. The library allows app developers to turn this on by configuring the logPii property on the AuthenticationContext. By turning on PII or OII, the app takes responsibility for safely handling highly-sensitive data and complying with any regulatory requirements.
26+
27+
```java
28+
//PII or OII logging disabled. Default Logger does not capture any PII or OII
29+
AuthenticationContext context = new AuthenticationContext(...);
30+
31+
//PII or OII logging enabled
32+
context.setLogPii(true);
33+
```
1934

2035
## Community Help and Support
2136

@@ -35,15 +50,3 @@ All code is licensed under the MIT License and we triage actively on GitHub. We
3550

3651
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
3752

38-
## Logging
39-
40-
The Library uses The Simple Logging Facade for Java (SLF4J) as a simple facade or abstraction for various logging frameworks.
41-
42-
For regular logs we use class names as logger names.
43-
For log which might contains Pii(personally identifiable information) class names preceded by prefix "adal4jPii." are used.
44-
So, for the same class, for instance Foo, we define two loggers:
45-
46-
com.microsoft.aad.adal4j.Foo - no Pii data
47-
48-
adal4jPii.com.microsoft.aad.adal4j.Foo - might contain Pii data
49-

changelog.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 1.5.0
2+
=============
3+
- added device code flow api
4+
- added pii logging flag
5+
- updated gson to version 2.8.0 and slf4j to version 1.7.21
6+
17
Version 1.4.0
28
=============
39
- pii (personal identifiable information) Logger added
@@ -41,5 +47,5 @@ Version 1.1.0
4147
Version 1.0.1
4248
=============
4349
GA release of the API to support
44-
- server-2-server flows
50+
- server-2-server flows
4551
- resource owner grant flow for command line apps

contributing.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# CONTRIBUTING
2+
3+
Azure Active Directory SDK projects welcomes new contributors. This document will guide you
4+
through the process.
5+
6+
### CONTRIBUTOR LICENSE AGREEMENT
7+
8+
Please visit [https://cla.microsoft.com/](https://cla.microsoft.com/) and sign the Contributor License
9+
Agreement. You only need to do that once. We can not look at your code until you've submitted this request.
10+
11+
12+
### FORK
13+
14+
Fork the project [on GitHub][] and check out
15+
your copy.
16+
17+
Example for ADAL Java:
18+
19+
```
20+
$ git clone git@github.com:username/azure-activedirectory-library-for-java.git
21+
$ cd azure-activedirectory-library-for-java
22+
$ git remote add upstream git@github.com:AzureAD/azure-activedirectory-library-for-java.git
23+
```
24+
25+
Now decide if you want your feature or bug fix to go into the dev branch
26+
or the master branch. **All bug fixes and new features should go into the dev branch.**
27+
28+
The master branch is effectively frozen; patches that change the SDKs
29+
protocols or API surface area or affect the run-time behavior of the SDK will be rejected.
30+
31+
Some of our SDKs have bundled dependencies that are not part of the project proper. Any changes to files in those directories or its subdirectories should be sent to their respective
32+
projects. Do not send your patch to us, we cannot accept it.
33+
34+
In case of doubt, open an issue in the [issue tracker][].
35+
36+
Especially do so if you plan to work on a major change in functionality. Nothing is more
37+
frustrating than seeing your hard work go to waste because your vision
38+
does not align with our goals for the SDK.
39+
40+
41+
### BRANCH
42+
43+
Okay, so you have decided on the proper branch. Create a feature branch
44+
and start hacking:
45+
46+
```
47+
$ git checkout -b my-feature-branch
48+
```
49+
50+
### COMMIT
51+
52+
Make sure git knows your name and email address:
53+
54+
```
55+
$ git config --global user.name "J. Random User"
56+
$ git config --global user.email "j.random.user@example.com"
57+
```
58+
59+
Writing good commit logs is important. A commit log should describe what
60+
changed and why. Follow these guidelines when writing one:
61+
62+
1. The first line should be 50 characters or less and contain a short
63+
description of the change prefixed with the name of the changed
64+
subsystem (e.g. "net: add localAddress and localPort to Socket").
65+
2. Keep the second line blank.
66+
3. Wrap all other lines at 72 columns.
67+
68+
A good commit log looks like this:
69+
70+
```
71+
fix: explaining the commit in one line
72+
73+
Body of commit message is a few lines of text, explaining things
74+
in more detail, possibly giving some background about the issue
75+
being fixed, etc etc.
76+
77+
The body of the commit message can be several paragraphs, and
78+
please do proper word-wrap and keep columns shorter than about
79+
72 characters or so. That way `git log` will show things
80+
nicely even when it is indented.
81+
```
82+
83+
The header line should be meaningful; it is what other people see when they
84+
run `git shortlog` or `git log --oneline`.
85+
86+
Check the output of `git log --oneline files_that_you_changed` to find out
87+
what directories your changes touch.
88+
89+
90+
### REBASE
91+
92+
Use `git rebase` (not `git merge`) to sync your work from time to time.
93+
94+
```
95+
$ git fetch upstream
96+
$ git rebase upstream/v0.1 # or upstream/master
97+
```
98+
99+
100+
### TEST
101+
102+
Bug fixes and features should come with tests. Add your tests in the
103+
test directory. This varies by repository but often follows the same convention of /src/test. Look at other tests to see how they should be
104+
structured (license boilerplate, common includes, etc.).
105+
106+
107+
Make sure that all tests pass.
108+
109+
110+
### PUSH
111+
112+
```
113+
$ git push origin my-feature-branch
114+
```
115+
116+
Go to https://github.com/username/azure-activedirectory-library-for-***.git and select your feature branch. Click
117+
the 'Pull Request' button and fill out the form.
118+
119+
Pull requests are usually reviewed within a few days. If there are comments
120+
to address, apply your changes in a separate commit and push that to your
121+
feature branch. Post a comment in the pull request afterwards; GitHub does
122+
not send out notifications when you add commits.
123+
124+
125+
[on GitHub]: https://github.com/AzureAD/azure-activedirectory-library-for-java
126+
[issue tracker]: https://github.com/AzureAD/azure-activedirectory-library-for-java/issues

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.microsoft.azure</groupId>
55
<artifactId>adal4j</artifactId>
6-
<version>1.4.0</version>
6+
<version>1.5.0</version>
77
<packaging>jar</packaging>
88
<name>adal4j</name>
99
<description>
@@ -75,12 +75,12 @@
7575
<dependency>
7676
<groupId>com.google.code.gson</groupId>
7777
<artifactId>gson</artifactId>
78-
<version>2.2.4</version>
78+
<version>2.8.0</version>
7979
</dependency>
8080
<dependency>
8181
<groupId>org.slf4j</groupId>
8282
<artifactId>slf4j-api</artifactId>
83-
<version>1.7.5</version>
83+
<version>1.7.21</version>
8484
</dependency>
8585
<dependency>
8686
<groupId>commons-codec</groupId>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// All rights reserved.
3+
//
4+
// This code is licensed under the MIT License.
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files(the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions :
12+
//
13+
// The above copyright notice and this permission notice shall be included in
14+
// all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
// THE SOFTWARE.
23+
24+
package com.microsoft.aad.adal4j;
25+
26+
class AcquireDeviceCodeCallable extends AdalCallable<DeviceCode> {
27+
private String clientId;
28+
private String resource;
29+
30+
AcquireDeviceCodeCallable(AuthenticationContext context,
31+
String clientId, String resource,
32+
AuthenticationCallback<DeviceCode> callback) {
33+
super(context, callback);
34+
this.headers = new ClientDataHttpHeaders(context.correlationId);
35+
this.clientId = clientId;
36+
this.resource = resource;
37+
}
38+
39+
DeviceCode execute() throws Exception {
40+
context.authenticationAuthority.doInstanceDiscovery(headers.getReadonlyHeaderMap(),
41+
context.proxy, context.sslSocketFactory);
42+
return DeviceCodeRequest.execute(context.authenticationAuthority.getDeviceCodeEndpoint(),
43+
clientId, resource, headers.getReadonlyHeaderMap(), context.proxy, context.sslSocketFactory);
44+
}
45+
}

0 commit comments

Comments
 (0)