Skip to content

Commit 6b808ef

Browse files
authored
Add support for GitHub sign-in via Generic IDP (#1719)
2 parents dd83726 + 7fdf3ce commit 6b808ef

File tree

23 files changed

+57
-667
lines changed

23 files changed

+57
-667
lines changed

app/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ dependencies {
3737
implementation(Config.Libs.Androidx.multidex)
3838

3939
implementation(project(":auth"))
40-
implementation(project(":auth-github"))
4140
implementation(project(":firestore"))
4241
implementation(project(":database"))
4342
implementation(project(":storage"))

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class AuthUiActivity extends AppCompatActivity {
7979
@BindView(R.id.apple_provider) CheckBox mUseAppleProvider;
8080
@BindView(R.id.microsoft_provider) CheckBox mUseMicrosoftProvider;
8181
@BindView(R.id.yahoo_provider) CheckBox mUseYahooProvider;
82+
@BindView(R.id.github_provider) CheckBox mUseGitHubProvider;
8283

8384
@BindView(R.id.default_layout) RadioButton mDefaultLayout;
8485
@BindView(R.id.custom_layout) RadioButton mCustomLayout;
@@ -182,6 +183,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
182183
mUseMicrosoftProvider.setChecked(false);
183184
mUseYahooProvider.setChecked(false);
184185
mUseAppleProvider.setChecked(false);
186+
mUseGitHubProvider.setChecked(false);
185187
}
186188
}
187189
});
@@ -432,6 +434,10 @@ private List<IdpConfig> getSelectedProviders() {
432434
selectedProviders.add(new IdpConfig.AppleBuilder().build());
433435
}
434436

437+
if (mUseGitHubProvider.isChecked()) {
438+
selectedProviders.add(new IdpConfig.GitHubBuilder().build());
439+
}
440+
435441
return selectedProviders;
436442
}
437443

app/src/main/res/layout/auth_ui_layout.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@
123123
android:checked="true"
124124
android:text="@string/providers_yahoo" />
125125

126+
<CheckBox
127+
android:id="@+id/github_provider"
128+
android:layout_width="wrap_content"
129+
android:layout_height="wrap_content"
130+
android:checked="true"
131+
android:text="@string/providers_github" />
132+
126133
<TextView
127134
style="@style/Base.TextAppearance.AppCompat.Subhead"
128135
android:layout_width="wrap_content"

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<string name="providers_apple">Apple</string>
3434
<string name="providers_microsoft">Microsoft</string>
3535
<string name="providers_yahoo">Yahoo</string>
36+
<string name="providers_github">GitHub</string>
3637

3738
<string name="layout_header">Layout</string>
3839
<string name="layout_default">Default</string>

auth-github/build.gradle.kts

Lines changed: 0 additions & 16 deletions
This file was deleted.

auth-github/src/main/AndroidManifest.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

auth-github/src/main/java/com/firebase/ui/auth/data/model/GitHubProfile.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

auth-github/src/main/java/com/firebase/ui/auth/data/model/GitHubTokenResponse.java

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)