we are doing custom authentication in oracle apex,
if user enter charater (allow only number) INVALID_NUMBER exception appear in pl sql
message successfully appear by apex_error.add_error but on next attempt we got message "Your session has expired", as i understand
apex_error.add_error destroy session . My question is how to contain session alive after apex_error.add_error
or how to regenerate sesison after message
exception when INVALID_NUMBER then
apex_error.add_error(
p_message => 'UserName Must be Number',
p_display_location => apex_error.c_inline_in_notification);
I hope you can use apex_util.set_custom_auth_status for the notification.
apex_util.set_custom_auth_status (p_status => 'UserName Must be Number..!');
Related
Im trying to remove user snapshot from firebase database with method onDisconnect()
here is my code:
lastOnlineRef
.onDisconnect()
.set(ServerValue.timestamp)
.then(()=>firebaseController.removeThisUser(roomId: uid));
Before I tried:
lastOnlineRef
.onDisconnect()
.set(ServerValue.timestamp)
.then(firebaseController.removeThisRoom(roomId: uid));
and then I receive the error:
Unhandled Exception: type 'Future<dynamic>' is not a subtype of type '(void) => dynamic'
Here is removeThisRoom method:
removeThisRoom({String roomId}) {
print('removeThisRoom被触发');
final databaseReference = FirebaseDatabase.instance.ref();
final roomRef = databaseReference.child('/waitingList/$roomId');
roomRef.remove();
}
For now it is failed to remove this user from database when device is offline, Please tell me if it is the right solution, when device is offline totally and should inform database this user is unavailable.
My second solution is just to update the status of this user to unavailable instead of remove this user completely from
I am using sign up with email in my Flutter app and using Firebase Authentication for the same. How do I show on the sign up page whether the entered email and username already exist in the database?
firebase will return that info as an error message:
FirebaseAuth.instance.createUserWithEmailAndPassword(email: _email, password: _password).then((user) {
// do whatever you want to do with new user object
}).catchError((e) {
print(e.details); // code, message, details
});
if the email exists it'll trigger the catchError. it's worth noting that 'details' is the human readable error getter. 'code' and 'message' are useless to an end user, but those are the only two documented on firebase_auth.
I want to return the Login Error Message even user key-in their privileges correctly. In other words, to terminate the login and show the error message.
When we key-in wrong passwords, wordpress shows:
There was an error authenticating your details.
ERROR: The password you entered for the username admin is incorrect. Lost your password?
.. on the login page. This is because of WP_Error Object is returned.
So my curious question is:
How to get/generate this WP_Error Object on my own, to return back? Is it Array?
You need to hook into the authenticate wordpress hook. Then return a new WP_Error object to generate an error message and redirect back to the login page. Here is an example.
add_filter('authenticate', 'check_login_submit', 40, 3);
function check_login_submit($user, $username, $password) {
$WP_Error = new WP_Error();
$WP_Error->add('my_error', '<strong>Error</strong>: Something went wrong.');
return $WP_Error;
}
I would like to send a string via a socket to an external display unit via the oracle 11g database
I gather that the character or string first has to be converted to hex and at the end of the string a checksum must be addead (to validate the string to be sent)
Can anyone tell me how a socket connection can be opened and a string can be sent?
Thank you
DECLARE
bt_conn UTL_TCP.connection;
retval BINARY_INTEGER;
l_sequence VARCHAR2 (50) := '#0100010303000118000201001401000201'; --string to be sent
BEGIN
bt_conn :=
UTL_TCP.open_connection (remote_host => '127.0.0.1', --IP of socket to be opened
remote_port => 26665, -- port number of socket
tx_timeout => 15);
DBMS_LOCK.SLEEP(1); -- this is to ensure a slight pause once opening the connection before --sending the string
retval := UTL_TCP.write_line (bt_conn, l_sequence);
UTL_TCP.flush (bt_conn);
UTL_TCP.close_connection (bt_conn);
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (-20101, SQLERRM);
UTL_TCP.close_connection (bt_conn);
end;
Theoretically you can achieve this by using Java stored procedure - if you grant yourself priv to open a TCP socket from Oracle JVM. But this way the data will be sent regardless on transaction result(commit or rollback). The better solution would to store those strings in some queue table and then withdraw them using some external process.
You can also use DBMS_PIPE.
I am at the intermediate level in php and am new with facebook development. I have looked through the facebook documents and Stack Overflow previous comments.
All I basically wanted to do was let the user log in with their Facebook account and display their name.
My php page has a graph, and the page auto refreshes every 2 or 5 min.
I authenticate and get the facebook first_name to put on the page.
$graph = $facebook->api('/me');
echo $graph['first_name'] to get the first name of the user .. (for which I thought that no access token was required).
After about 90 min. I have been receiving the error:
fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user......
and I have no value ( 0 ), in the $facebook->getUser(); parameter
I do know that off line access permission has been depreciated, (and I have have this enabled in my apps advanced settings)
I am trying to get an extended access token. In the FB docs. I see:
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN
I included my information in the link(an existing valid access token and all) and received a access token:
access_token=AAADbZBPuUyWwBAFubPaK9E6CnNsPfNYBjQ9OZC63ZBN2Ml9TCu9BYz89frzUF2EnLttuZAcG2fWZAHbWozrvop9bQjQclxVYle7igvoZCYUAg2KNQLMgNP&expires=4050
Yet this token expired in about 1 hour or so.(....expires=4050)
I assume I am using server side auth because I am using PHP?
I assume you need to enable "deprecate offline_access" in your Apps Advanced Settings page. As this worked for me:
//added code in base_facebook.php inside the facebook class
public function getExtendedAccessToken(){
try {
// need to circumvent json_decode by calling _oauthRequest
// directly, since response isn't JSON format.
$access_token_response =
$this->_oauthRequest(
$this->getUrl('graph', '/oauth/access_token'),
$params = array( 'client_id' => $this->getAppId(),
'client_secret' => $this->getAppSecret(),
'grant_type'=>'fb_exchange_token',
'fb_exchange_token'=>$this->getAccessToken(),
));
} catch (FacebookApiException $e) {
// most likely that user very recently revoked authorization.
// In any event, we don't have an access token, so say so.
return false;
}
if (empty($access_token_response)) {
return false;
}
$response_params = array();
parse_str($access_token_response, $response_params);
if (!isset($response_params['access_token'])) {
return false;
}
return $response_params['access_token'];
}
The token can still be invalid for several reasons, See How-To: Handle expired access tokens.
Hope it helps
There's a bug on this:
https://developers.facebook.com/bugs/241373692605971
But, another question on SO has a workaround (user uninstalls and re-installs):
fb_exchange_token for PHP only working once user removes app