-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #833 from taylorhadden/ERGoogleSignIn
Sign in with google easily with ERGoogleSignIn
- Loading branch information
Showing
40 changed files
with
631 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="Sources"/> | ||
<classpathentry kind="con" path="WOFramework/ERExtensions"/> | ||
<classpathentry kind="con" path="WOFramework/ERJars"/> | ||
<classpathentry kind="con" path="WOFramework/ERPrototypes"/> | ||
<classpathentry kind="con" path="WOFramework/ERAttributeExtension"/> | ||
<classpathentry kind="con" path="WOFramework/JavaWOExtensions"/> | ||
<classpathentry kind="con" path="WOFramework/WOOgnl"/> | ||
<classpathentry kind="con" path="WOFramework/JavaEOAccess"/> | ||
<classpathentry kind="con" path="WOFramework/JavaEOControl"/> | ||
<classpathentry kind="con" path="WOFramework/JavaFoundation"/> | ||
<classpathentry kind="con" path="WOFramework/JavaJDBCAdaptor"/> | ||
<classpathentry kind="con" path="WOFramework/JavaWebObjects"/> | ||
<classpathentry kind="con" path="WOFramework/JavaXML"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/commons-logging-1.1.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-api-client-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-api-client-gson-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-api-client-java6-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-http-client-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-http-client-gson-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-oauth-client-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/google-oauth-client-java6-1.22.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/gson-2.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/httpclient-4.0.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/httpcore-4.0.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/jetty-6.1.26.jar"/> | ||
<classpathentry exported="true" kind="lib" path="Libraries/jetty-util-6.1.26.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ERGoogleSignIn</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.objectstyle.wolips.incrementalbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.objectstyle.wolips.incrementalframeworknature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
Frameworks/Misc/ERGoogleSignIn/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding//Components=UTF-8 |
16 changes: 16 additions & 0 deletions
16
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLoginForm.api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<wodefinitions> | ||
<wo class="ERGoogleLoginForm" wocomponentcontent="false"> <binding name="clientID"/> | ||
<binding name="clientIDName"/> | ||
<binding name="directActionClass"/> | ||
<binding name="directActionName"/> | ||
<binding name="error"/> | ||
<validation message="'error' is a required binding."> | ||
<unbound name="error"/> | ||
</validation> | ||
<binding name="formName"/> | ||
<binding name="id"/> | ||
<binding name="includePlatformScript"/> | ||
<binding name="tokenFieldName"/> | ||
</wo> | ||
</wodefinitions> |
34 changes: 34 additions & 0 deletions
34
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLoginForm.wo/ERGoogleLoginForm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<webobject name = "GoogleContainer"></webobject> | ||
<webobject name = "GoogleForm"> | ||
<webobject name = "AuthenticationTokenField"></webobject> | ||
</webobject> | ||
|
||
<wo:WOConditional condition = "$includePlatformScript"> | ||
<script src="https://apis.google.com/js/platform.js"></script> | ||
</wo:WOConditional> | ||
<script> | ||
var invalidUser = false; | ||
<wo:WOConditional condition = "$^error">invalidUser = true;</wo:WOConditional> | ||
|
||
gapi.load('auth2', function() { | ||
auth2 = gapi.auth2.init({ | ||
client_id: '<wo:WOString value = "$clientID"/>' | ||
}); | ||
|
||
auth2.currentUser.listen(function(user) { | ||
if (invalidUser) { | ||
auth2.signOut().then(function() { invalidUser = false; }); | ||
} | ||
else { | ||
let token = user.getAuthResponse().id_token; | ||
if (token) { | ||
var form = document.forms['<wo:WOString value = "$formName"/>']; | ||
form.<wo:WOString value = "$tokenFieldName"/>.value = token; | ||
form.submit(); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
gapi.signin2.render('<wo:WOString value = "$id"/>'); | ||
</script> |
17 changes: 17 additions & 0 deletions
17
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLoginForm.wo/ERGoogleLoginForm.wod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
GoogleContainer : WOGenericContainer { | ||
elementName = "div"; | ||
id = id; | ||
} | ||
|
||
GoogleForm : WOForm { | ||
style = "display: none;"; | ||
multipleSubmit = false; | ||
name = formName; | ||
directActionName = directActionName; | ||
actionClass = directActionClass; | ||
} | ||
|
||
AuthenticationTokenField : WOTextField { | ||
value = token; | ||
name = tokenFieldName; | ||
} |
4 changes: 4 additions & 0 deletions
4
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLoginForm.wo/ERGoogleLoginForm.woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"WebObjects Release" = "WebObjects 5.0"; | ||
encoding = "UTF-8"; | ||
} |
13 changes: 13 additions & 0 deletions
13
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLogoutLink.api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<wodefinitions> | ||
<wo class="ERGoogleLogoutLink" wocomponentcontent="true"> <binding name="action"/> | ||
<validation message="'action' is a required binding."> | ||
<unbound name="action"/> | ||
</validation> | ||
<binding name="clientID"/> | ||
<binding name="clientIDName"/> | ||
<binding name="includeInitializationScript"/> | ||
<binding name="includePlatformScript"/> | ||
<binding name="target"/> | ||
</wo> | ||
</wodefinitions> |
12 changes: 12 additions & 0 deletions
12
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLogoutLink.wo/ERGoogleLogoutLink.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<wo:WOConditional condition = "$includePlatformScript"><script src="https://apis.google.com/js/platform.js"></script></wo:WOConditional> | ||
<wo:WOConditional condition = "$includeInitializationScript"> | ||
<script> | ||
var auth2; | ||
gapi.load('auth2', function() { | ||
auth2 = gapi.auth2.init({ | ||
client_id: '<wo:WOString value = "$clientID"/>' | ||
}); | ||
}); | ||
</script> | ||
</wo:WOConditional> | ||
<webobject name = "Link"><webobject name = "Content"></webobject></webobject> |
9 changes: 9 additions & 0 deletions
9
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLogoutLink.wo/ERGoogleLogoutLink.wod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Link : WOHyperlink { | ||
action = ^action; | ||
target = ^target; | ||
onclick = "gapi.auth2.getAuthInstance().signOut(); return true;"; | ||
} | ||
|
||
Content : WOComponentContent { | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
Frameworks/Misc/ERGoogleSignIn/Components/ERGoogleLogoutLink.wo/ERGoogleLogoutLink.woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"WebObjects Release" = "WebObjects 5.0"; | ||
encoding = "UTF-8"; | ||
} |
Oops, something went wrong.