authentication - Authenticating users with IdentityServer4 without a Login page -
we built xamarin.forms app operates identityserver4 client using webview implementation approach, worked perfectly. however, apple not accept our app in store because want authentication , new account creation occur within app. therefore, i've been trying post credentials entered within app's login screen identityserver hope can simulate same process occurs when user enters credentials , submits (posts) login page:
public async task<iactionresult> authenticate([frombody] userloginviewmodel model) { string result = string.empty; try { if (!string.isnullorwhitespace(model.username)) { userkey user = await _usermanager.findbynameasync(model.username.tolowerinvariant()); if (string.isnullorempty(user?.ssid)) { result = authenticateresultenum.userdoesnotexist.tostring(); } else { var signin_result = await _signinmanager.passwordsigninasync(user, model.password, model.rememberlogin, false); if (signin_result.succeeded) { if (_interactionservice.isvalidreturnurl(model.returnurl)) { localredirect(model.returnurl); } } else if (signin_result.islockedout) { result = authenticateresultenum.accountlocked.tostring(); } } } } catch (exception ex) { result = authenticateresultenum.error.tostring(); _logger.exceptionasync(ex); } return new jsonresult(result); }
however, i've had no luck process because of redirects involved. there well-established way of authenticating user identityserver without showing login page, instead posting credentials , authorization request apps login form? other well-known apps appear able so, i'm seeking confirmation can done identityserver4.
thank you, andrew
Comments
Post a Comment