Tag: 认证

在Android应用中,Firebase登录失败

我的应用程序显示在登录失败firebase上的错误..在日志中说 – com,google.firebase.auth没有find。 该怎么办 ? 我已启用电子邮件/密码登录在Firebase控制台这里是我的代码。 public override fun onStart(){super.onStart() // Check auth on Activity start if (mAuth!!.currentUser != null) { onAuthSuccess(mAuth!!.currentUser) } } private fun signIn() { Log.d(TAG, “signIn”) if (!validateForm()) { return } showProgressDialog() val email = mEmailField!!.text.toString() val password = mPasswordField!!.text.toString() mAuth!!.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this) { task -> Log.d(TAG, “signIn:onComplete:” + task.isSuccessful) hideProgressDialog() […]

以下类的超types无法解析

我有android app在kotlin这是给我这个错误.. 错误:以下类的超types无法解析。 请确保您在类路径中具有所需的依赖关系:com.google.firebase.auth.FirebaseAuth,未解析的超types:com.google.android.gms.internal.aad 和这个 错误:执行任务’:app:compileDebugKotlin’失败。 编译错误。 查看日志了解更多详情 这是我的应用程序模块 apply plugin: ‘com.android.application’ apply plugin: ‘kotlin-android’ apply plugin: ‘kotlin-android-extensions’ android { compileSdkVersion 26 defaultConfig { applicationId “appname” minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName “1.0” testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner” } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } } } dependencies { implementation fileTree(dir: ‘libs’, include: […]

使用JWT和OAuth2

当我需要外部供应商时,可以使用JWT和OAuth2吗? 我应该这样做吗? 主要优点: JWT是简单的令牌,可以在任何平台上轻松使用 OAuth2让我轻松使用外部提供者 试图使用这两个已经驱使我到需要令牌的问题,以及通过身份登录。 我更喜欢JWT,所以我可以在任何平台上以相同的方式使用它,我可以看到如何在没有像ASP.NET标识这样的抽象的情况下工作。 但是,在我看来,OAuth2更好地使用ASP.NET。 我的Web应用程序的主要目的是为Angular和Kotlin移动应用程序提供API。

Spring Security多个成功的认证提供商

我希望我的Web应用程序的用户通过LDAP和其他自定义身份validation进行身份validation。 这是一个用Kotlin编写的Spring Boot应用程序。 我已经配置AuthenticationManagerBuilder如下 @Autowired lateinit var authenticationProvider: CustomAuthenticationProvider override fun configure(auth: AuthenticationManagerBuilder) { auth .authenticationProvider(authenticationProvider) auth .ldapAuthentication() .userDnPatterns(“uid={0},ou=people”) .groupSearchBase(“ou=groups”) .contextSource() .url(“ldap://localhost:8389/dc=example,dc=com”) .and() .passwordCompare() .passwordEncoder(PlaintextPasswordEncoder()) .passwordAttribute(“userPassword”) } 我想连锁身份validation,以便如果CustomAuthenticationProvider成功身份validation(function身份validation不会抛出)身份validation继续使用LDAP身份validation提供程序。 如果CustomAuthenticationProvider成功进行身份validation,则写入LDAP身份validation(以及任何后续的身份validation提供程序)不会被评估。 只有在CustomAuthenticationProvider引发时才执行LDAP认证。 我已经阅读了许多文章(例如Spring Security中的多个身份validation提供者),详细描述了具有多个身份validation提供程序但具有OR行为而非AND行为的文章。 有什么建议么?

如何在Kotlin中使用Firebase实现电话身份validation?

我正在开发使用Firebase电话认证的Kotlin应用程序。 我很困惑实施此validation号码。 private fun startPhoneNumberVerification(phoneNumber: String, mCallbacks: PhoneAuthProvider.OnVerificationStateChangedCallbacks?) { Log.d(“phoneNumber==”, “” + phoneNumber); PhoneAuthProvider.getInstance().verifyPhoneNumber( phoneNumber, // Phone number to verify 60, // Timeout duration TimeUnit.SECONDS, // Unit of timeout this@LoginActivity, // Activity (for callback binding) mCallbacks) } 在上面的代码中实现并获取错误(“下面的函数不能用提供的arctuments调用”)以及“创建扩展函数PhoneAuthProvider?.verifyPhoneNumber”。 有人可以指导我吗?

Firebase连接在Kotlin上创建用户错误

ı尝试与kotlin的firebase创建用户。 但是我总是得到错误敬酒Theese是我的import: import android.content.Intent import android.support.v7.app.AppCompatActivity import android.os.Bundle import android.text.TextUtils import android.view.View import android.widget.Toast import com.google.firebase.auth.FirebaseAuth import kotlinx.android.synthetic.main.activity_create_user.* 这里剩下的我的代码类createUser:AppCompatActivity(){private var fbsignup:FirebaseAuth = FirebaseAuth.getInstance() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_create_user) submitButton.setOnClickListener { val email = userSaveText.text.toString().trim() val password = passSaveText.text.toString().trim() if (TextUtils.isEmpty(email)) { Toast.makeText(this, “enter a mail “, Toast.LENGTH_SHORT).show() return@setOnClickListener } if (TextUtils.isEmpty(password)) { Toast.makeText(this, […]