Skip to content

Commit

Permalink
[chore] tested Google native login
Browse files Browse the repository at this point in the history
  • Loading branch information
Achintha Isuru committed May 4, 2024
1 parent 8b7e02e commit 5450f0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AsgardeoAuthRepositoryImpl @Inject constructor() : AsgardeoAuthRepository
override fun initializeAsgardeoAuth(integrityToken: String?) {
asgardeoAuth = AsgardeoAuth.getInstance(
AuthenticationCoreConfig(
// Change these values at your discretion
authorizeEndpoint = Config.getAuthorizeUrl(),
tokenEndpoint = Config.getTokenUrl(),
logoutEndpoint = Config.getLogoutUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
package com.wso2_sample.api_auth_sample.features.login.presentation.screens.auth_screen.components

import android.content.Intent
import android.os.Build
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
Expand All @@ -31,6 +33,7 @@ import com.wso2_sample.api_auth_sample.features.login.presentation.screens.auth_
import com.wso2_sample.api_auth_sample.features.login.presentation.util.common_component.AuthButton

//@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@Composable
internal fun GoogleNativeAuth(
viewModel: AuthScreenViewModel = hiltViewModel(),
Expand All @@ -48,7 +51,9 @@ internal fun GoogleNativeAuth(
authenticator.authenticatorId,
launcher
)
//viewModel.authenticateWithGoogle(authenticatorType.authenticatorId)

// Using the Google Credential Manager API
//viewModel.authenticateWithGoogleNative(authenticator.authenticatorId)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ class LandingScreenViewModel @Inject constructor(
}
viewModelScope.launch {
authenticationProvider.initializeAuthentication(applicationContext)
}
_state.update { landingScreenState ->
landingScreenState.copy(isLoading = false)
_state.update { landingScreenState ->
landingScreenState.copy(isLoading = false)
}
}
}

private fun isLoggedInStateFlow() {
viewModelScope.launch {
authenticationProvider.isLoggedInStateFlow(applicationContext)
}
_state.update { landingScreenState ->
landingScreenState.copy(isLoading = false)
_state.update { landingScreenState ->
landingScreenState.copy(isLoading = false)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pluginManagement {
maven {
url = uri("https://maven.wso2.org/nexus/content/repositories/releases")
}
// maven {
// url = uri("file:/Users/<username>/.m2/repository")
// }
}
}
dependencyResolutionManagement {
Expand All @@ -40,6 +43,9 @@ dependencyResolutionManagement {
maven {
url = uri("https://maven.wso2.org/nexus/content/repositories/releases")
}
// maven {
// url = uri("file:/Users/<username>/.m2/repository")
// }
}
}

Expand Down

0 comments on commit 5450f0b

Please sign in to comment.