Skip to content

Commit

Permalink
Translating comments from Japanese into English (initial work)
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Mestrone committed Apr 4, 2016
1 parent 42b4283 commit 47d62a6
Show file tree
Hide file tree
Showing 14 changed files with 259 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
62 changes: 62 additions & 0 deletions AzureAD-Login-WebApp-OAuth/AzureAD-Login-WebApp-OAuth.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="glassfish-web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/glassfish-web.xml" />
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.primefaces:primefaces:5.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax:javaee-api:7.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.mail:javax.mail:1.5.0" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.jersey.media:jersey-media-json-jackson:2.22.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.jersey.core:jersey-common:2.22.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.ws.rs:javax.ws.rs-api:2.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.annotation:javax.annotation-api:1.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2:hk2-api:2.4.0-b34" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2:hk2-utils:2.4.0-b34" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.4.0-b34" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2.external:javax.inject:2.4.0-b34" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2:hk2-locator:2.4.0-b34" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish.jersey.ext:jersey-entity-filtering:2.22.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.5.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-core:2.5.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.5.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.5.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.5.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.5.4" level="project" />
<orderEntry type="library" name="Maven: com.microsoft.azure:adal4j:1.1.2" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:oauth2-oidc-sdk:4.5" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
<orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.1" level="project" />
<orderEntry type="library" name="Maven: net.minidev:json-smart:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:lang-tag:1.4" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:nimbus-jose-jwt:3.1.2" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.51" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.16.6" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ public void init() {
}

/* ユーザ一覧の取得 */
/* ユーザいちらんのしゅとく */
/* Getting the user list */
public void pushGetUsersInfo() {
selectionModel = getSelectionModel();
}
/* グループ一覧の取得 */
/* グループいちらんのしゅとく */
/* Getting the group list */
public void pushGetGroupsInfo() {
if (groupSelectionModel == null) {
List<ADGroup> data = Arrays.asList(graph.getAllADGroupFromGraph().getValue());
Expand All @@ -88,12 +92,16 @@ public void pushGetGroupsInfo() {
}
}
/* 特定ユーザの詳細情報の取得 */
/* とくていユーザのしょうさいじょうほうのしゅとく */
/* Getting detailed information about a specific user */
public void onUserRowSelect(SelectEvent event) {
String id = ((ADUser) event.getObject()).getObjectId();
user = graph.getADUserFromGraph(id);
memberOfGroup = graph.getMemberOfGroup(id).getValue();
}
/* 特定グループに含まれるユーザ情報の取得 */
/* とくていグループにふくまれるユーザじょうほうのしゅとく */
/* Getting information about the user included in a specific group */
public void onGroupRowSelect(SelectEvent event) {
String groupid = ((ADGroup) event.getObject()).getObjectId();
users = graph.getAllUsersInGroup(groupid).getValue();
Expand All @@ -102,14 +110,26 @@ public void onGroupRowSelect(SelectEvent event) {
/*
* Admin 権限の有無のチェック
*/
/*
* Admin けんげんのうむのチェック
*/
/*
* Check for admin privileges
*/
public boolean isAdmin() {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
return externalContext.isUserInRole("admin");
}
/*
* ユーザが持つ権限に応じた処理例
*/
public String nextPage() {
/*
* ユーザがもつけんげんにおうじたしょりれい
*/
/*
* Sample processing in response to privileges held by the user
*/
public String nextPage() {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
if (externalContext.isUserInRole("admin")) {
return "nextAdmin";
Expand All @@ -123,6 +143,12 @@ public String nextPage() {
/**
* @return ユーザのメールアドレスと所属グループの取得
*/
/**
* @return ユーザのメールアドレスとしょぞくグループのしゅとく
*/
/**
* @return a user's email address and group membership
*/
public String getNameAndAddress() {
Principal userPrincipal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
String uid = userPrincipal.getName();
Expand All @@ -131,6 +157,8 @@ public String getNameAndAddress() {
}

/********** 以降は単なるセッタ・ゲッタ Lombok の導入でセッタ・ゲッタは省略可 *******************/
/********** いこうはたんなるセッタ・ゲッタ Lombok のどうにゅうでセッタ・ゲッタはしょうりゃくか *******************/
/********** From this point on, just plain getters and setters with the introduction of Lombok, getters and setters are optional *******************/
/**
* @param nameAndAddress the nameAndAddress to set
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ public class ADGroup {
private String mailNickname;
private String mailEnabled;
private String onPremisesSecurityIdentifier;
private String[] provisioningErrors;// どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] proxyAddresses;// どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] provisioningErrors; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String[] proxyAddresses; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String securityEnabled;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,23 @@ public class ADUser {
private String mailNickname;
private String mobile;
private String onPremisesSecurityIdentifier;
private String[] otherMails;// どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] otherMails; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String passwordPolicies;
private String passwordProfile;
private String physicalDeliveryOfficeName;
private String postalCode;
private String preferredLanguage;
private String[] provisionedPlans; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] provisioningErrors;// どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] proxyAddresses;// どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
private String[] provisionedPlans; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String[] provisioningErrors; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String[] proxyAddresses; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり(単なる文字配列でない場合の可能性)
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり(たんなるもじはいれつでないばあいのかのうせい)
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly (it is possible that a simple string won't do it)
private String sipProxyAddress;
private String state;
private String streetAddress;
Expand All @@ -69,7 +77,9 @@ public class ADUser {
private String usageLocation;
private String userPrincipalName;
private String userType;
private String[] signInNames; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり
private String[] signInNames; // どのような内容が入るかわからないので必要に応じ子クラスを作成する必要あり
// どのようなないようがはいるかわからないのでひつようにおうじこクラスをさくせいするひつようあり
// Because it's not clear what the content will be, it is necessary to create a subclass accordingly
private String isCompromised;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,31 @@

/*
参考情報
さんこうじょうほう
Reference information
Graph Explorer :ブラウザから参照可能な便利ツール
https://graphexplorer.cloudapp.net/ //現在の方
https://graphexplorer2.azurewebsites.net/ // 新しい方:まだ未対応
Graph Explorer :ブラウザからさんしょうかのうなべんりツール
Graph Explorer :Convenient tool accessible from the browser
https://graphexplorer.cloudapp.net/ //現在の方
//げんざいのほう
//Current one
https://graphexplorer2.azurewebsites.net/ // 新しい方:まだ未対応
// あたらしいほう:まだみたいおう
// New one: not supported yet
Graph API のクエリ例
Graph API のクエリ例
Graph API query examples
https://msdn.microsoft.com/Library/Azure/Ad/Graph/howto/azure-ad-graph-api-supported-queries-filters-and-paging-options#CommonQueries
https://graph.microsoft.io/ja-jp/docs/authorization/app_authorization
これを見ながら改造
//https://azure.microsoft.com/ja-jp/documentation/articles/active-directory-devquickstarts-webapp-java/
これをみながらかいぞう
Modified based on this
https://azure.microsoft.com/ja-jp/documentation/articles/active-directory-devquickstarts-webapp-java/
*/
/**
*
Expand Down Expand Up @@ -96,6 +111,8 @@ public void init(HttpServletRequest request) {
}

/* 登録済みの全ユーザ取得 */
/* とうろくずみのぜんユーザしゅとく */
/* Getting all registered users */
public ADUsers getAllADUserFromGraph() {
String graphURL = String.format("https://%s/%s/users", GRAPH_SEVER, tenant);

Expand All @@ -111,6 +128,8 @@ public ADUsers getAllADUserFromGraph() {
}

/* 指定した ID (メールアドレス・)に対応する ADのユーザ取得 */
/* していした ID (メールアドレス・)にたいおうする ADのユーザしゅとく */
/* Getting an AD user for a specified ID (mail address) */
public ADUser getADUserFromGraph(String id) {
String graphURL = String.format("https://%s/%s/users/%s", GRAPH_SEVER, tenant, id);
ADUser user = jaxrsClient.target(graphURL)
Expand Down Expand Up @@ -139,6 +158,8 @@ public ADGroups getAllADGroupFromGraph() {
}

/* 指定した グループID に対応するグループ取得 */
/* していした グループID にたいおうするグループしゅとく */
/* Getting an AD group for a specified group ID */
public ADGroup getADGroupFromGraph(String groupid) {
String graphURL = String.format("https://%s/%s/groups/%s", GRAPH_SEVER, tenant, groupid);

Expand All @@ -154,6 +175,8 @@ public ADGroup getADGroupFromGraph(String groupid) {
}

/* 指定した グループID に所属するユーザ一覧取得 */
/* していした グループID にしょぞくするユーザいちらんしゅとく */
/* Getting the list of users that belong to a specified group ID */
public ADUsers getAllUsersInGroup(String groupid) {
String graphURL = String.format("https://%s/%s/groups/%s/members", GRAPH_SEVER, tenant, groupid);
ADUsers users = jaxrsClient.target(graphURL)
Expand All @@ -168,6 +191,8 @@ public ADUsers getAllUsersInGroup(String groupid) {
}

/* 指定した ユーザID が所属するグループの一覧を取得 */
/* していした ユーザID がしょぞくするグループのいちらんをしゅとく */
/* Getting the list of group that a specified user ID belongs to */
public ADUserMemberOfGroups getMemberOfGroup(String userID) {
String graphURL = String.format("https://%s/%s/users/%s/getMemberGroups", GRAPH_SEVER, tenant, userID);
JsonObject model = Json.createObjectBuilder()
Expand Down
Loading

0 comments on commit 47d62a6

Please sign in to comment.