I am trying to integrate https://oauth.io/ into my application. Below is the code for facebook integration that I am using:
OAuth.popup('facebook')
.done(function (result) {
alert('sucess');
})
.fail(function (error) {
alert('fail');
});
Note: I am calling the above part of code in a button click.
In JQuery ready function I am calling OAuth.initialize("my_public_key");
When I click on the button I am getting "The parameter app_id is required" error in the popup. (added image of it)
Can someone let me know If I am missing something.
You must Integrate APIs in OAuth, follow the below method.
Login to your account.
Then click on the Integrated APIs menu from the left side bar.
Now click on ADD APIs green button on the right top corner.
Now Search and select Facebook.
Now add the Keys and Permission Scope details and others.
Related
I'm trying to login to our site which uses Auth0 and Google Sign in but I'm having issues with cy.origin it's behaving different in each browser, none of which is letting me log in. This is my test:
import { loginPage } from '../../page-objects/login-page'
describe('Login Tests', () => {
beforeEach(() => {
loginPage.visit()
})
it('GoogleLogin', () => {
// Click google sign in button - On My Base URL
cy.get("a[data-testid='googleSignInButton']").click()
// I'm now on an Auth0 Page where I click the Google Sign In Button
cy.get("a[class='auth0-lock-social-button auth0-lock-social-big-button']").click()
// Now I am on the accounts.google.com domain
cy.origin('https://accounts.google.com', () => {
// enter email on accounts.google.com
cy.get("input[type='email']").type('myemail#gmail.com')
// click next button seen on accounts.google.com page
cy.get(
"button[class='VfPpkd-LgbsSe VfPpkd-LgbsSe-OWXEXe-k8QpJ VfPpkd-LgbsSe-OWXEXe-dgl2Hf nCP5yc AjY5Oe DuMIQc LQeN7 qIypjc TrZEUc lw1w4b']",
).click()
})
})
})
The issues I'm seeing are:
In Chrome once I get to accounts.google.com the test times out with "Timed out after waiting 60000ms for your remote page to load on origin(s)"
In Firefox the test times out with the same error as on Chrome but on the Auth0 page instead of accounts.goole.com
In Electron when I click the Google Sign in button on Auth0 I'm taken to accounts.google.com but a message is displayed "403. That’s an error. We're sorry, but you do not have access to this page. That’s all we know."
In Edge I can get to accounts.google.com and enter "myemail#gmail.com" and click the next button but then I see a message "This browser or app may not be secure.
Try using a different browser. If you’re already using a supported browser, you can try again to sign in." with a Try again button.
Four browsers are all reacting differently and not one is letting me actually login, can anyone see what I've done wrong?
I am working on testing paypal checkout stuff using cypress. But the problem is that when the PayPal popup window opens, I don't know how to access these popup window elements. Can anyone help me to resolve this issue
Without a sample of the html, this will be a generic answer.
You will have to get the iframe of paypal, then drill down to its contents to be able to search within the paypal window elements.
cy.get('iframe')
.its('0.contentDocument.body')
// now you can search within the paypal window
In case you have any clicks you need to do, you may be redirected to another window, in which case you will have to use cy.origin().
cy.origin('paypal.com',
{ args: sentArgs },
({ url }) => {
const path = url.split('com/')
cy.visit(`/${path[1]}`)
)
I want to program a simple Outlook add-in that opens a browser and take the user to a specific site.
I've had a look at using Yeoman, but this add-in opens a task pane where I'm just looking to take that single actions.
Is there a simple way to do this?
EDIT:
I managed to get this done, but I not have the following issue: I have a single button (via Yeoman's generator) that when clicked executes the following:
function action(event) {
const message = {
type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Window opened.",
icon: "Icon.80x80",
persistent: true,
};
// Show a notification message
window.open("https://myurl.com");
Office.context.mailbox.item.notificationMessages.replaceAsync("action", message);
// Be sure to indicate when the add-in command function is complete
event.completed();
}
I get the following error in Outlook itself:
We deployed the app using the MS 365 admin center, but I'm not sure if there is something additional that I need to do in this case to run the webserver?
There is an Office.js API that will open a browser window:
Office.ui.openBrowserWindow( -- URL string here -- );
This will cause the computers default browser to open to the specified URL. You could have a button in the task pane whose handlers calls this method. Alternatively, you could have a custom button on the ribbon that calls a FunctionFile that calls this method.
If you want to display any web site to the user as a result of the button click or some action on the pane, try doing window.open('https://yoursite.com'). This should work if the domain is whitelisted in your manifest. For example:
function redirectFunction() {
window.open("https://othersite.com")
//window.location.href = "https://othersite.com";
}
I've integrated reCAPTCHA v3 in one of my forms. In onload, there's a token produced and google captcha logo in the bottom right corner. But when I submit the form, in console there is an error shown, "Error: No reCAPTCHA clients exist". Also, it seems, no data is fetched by "g-recaptcha-response" and $_POST["g-recaptcha-response"] remains empty.
Here is the sample code:
<script type="text/javascript">
var ReCaptchaCallbackV3 = function() {
grecaptcha.ready(function() {
grecaptcha.execute("site_key").then(function(token) {
console.log("v3 Token: " + token);
});
});
};
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=ReCaptchaCallbackV3&render=site_key"></script>
It doesn't produce any "g-recaptcha-response" when the form is submitted.
I don't know much about google reCaptcha. I've followed the documentation provided by them and used a site and a secret key in the proper way.
Can anybody please tell me where might be the problem and what is the possible solution?
I believe this error occurs when the reCaptcha api.js loads, but your container is not present on the page yet (at least for v2). I had this error occur in a React app when I navigated to the page rather than loading it as the first on. Instead of using render=explicit and using a global namespace onLoadCallback, I was able to resolve it by rendering the captcha element manually.
Instead of creating a <div class="g-recaptcha"></div>, give the container div an id only (<div id="recaptcha-container"></div>) and render it in your JS code (e.g. in componentDidMount for a React app):
grecaptcha.ready(function() {
grecaptcha.render("recaptcha-container", {
"sitekey": "your-site-key"
});
});
Have you tried loading the script before trying to send the request?
<script src="https://www.google.com/recaptcha/api.js?onload=ReCaptchaCallbackV3&render=site_key"></script>
<script type="text/javascript">
var ReCaptchaCallbackV3 = function() {
grecaptcha.ready(function() {
grecaptcha.execute("site_key").then(function(token) {
console.log("v3 Token: " + token);
});
});
};
</script>
When I came across this problem with reCAPTCHA v3, it was because I didn't pass it the correct site key.
This also happens in Recaptcha 2 before user interacts with it. So, I have a submit button that triggers a JS function that checks the value of recaptcha. To solve the no client exists problem, I did:
try {
data["reCaptcha"] = grecaptcha.getResponse();
} catch (err) {
data["reCaptcha"] = "";
}
The data object then gets sent to a back-end script that validates the recaptcha. The back-end also checks for the field being empty.
I had this problem because I was calling grecaptcha.reset(); when there wasn't any Recaptcha active on the site
grecaptcha.reset();
recaptcha__en.js:507 Uncaught Error: No reCAPTCHA clients exist.
at MX (recaptcha__en.js:507)
at Object.Zn [as reset] (recaptcha__en.js:514)
at <anonymous>:1:13
I was using React and only rendering my captcha container sometimes. Fixed by hiding the captcha button instead of not rendering it.
In my case grecaptcha.reset(); was present from previous code snippet, and I was programmatically invoking it.
As the captcha verification is going on the fly every time. Resetting wasn't required.
After eliminating this grecaptcha.reset(); my code works perfectly fine.
Maybe this hint can help someone.
We received this because we have a second environment with another domain and forgot to add this domain to the reCaptcha admin site. The solution was to add the new domain to the settings.
The steps are
Open www.google/recaptcha/admin/site
Select the site you're working on
Click on the settings gear
Add the domain in its respective section
I've integrated a hangout button into my website. When I click it a child window is opened. Is it possible to make hangout opened in current tab or in a new tab (like a usual link does)?
I've looked through Hangout Button documentation but haven't found anything like this (while I believe I saw it somewhere over the Internet).
Update There was a couple of examples how you can specify a new hangout url without Hangout Button in the answers and comment. But no proves were provided that this is a reliable way and no documentation was provided about the ways to specify additional parameters (e. g. startDate for Hangout App).
Update 2 I've found that when you create a new hangout app Google Develope Console provides a Hangout link:
with the following url: https://hangoutsapi.talkgadget.google.com/hangouts?authuser=0&gid=appId. Does it work only for sandbox? Is there any way to specify other parameters like startData?
I use the following to open hangout in a new tab
<a target="_blank" href="https://plus.google.com/hangouts/_?gid=<app_id">Start a Hangout</a>
Use the query parameter gd=somevalue to pass your app an initial set of data
https://developers.google.com/+/hangouts/running#passing-data
I send start data like this
https://plus.google.com/hangouts/_?gid=<app_id">&gd=<start_data>
and also like this
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div id="placeholder-rr"></div>
<script>
gapi.hangout.render('placeholder-rr', {
'render': 'createhangout',
'initial_apps': [{'app_id' : 'Your app_id', 'start_data' : 'Put your start data here', 'app_type' : 'ROOM_APP' }],
'widget_size': 175
});
</script>
Checked the documentation, doesn't seem that the button is meant to be flexible with configuration.
If you're looking for a coding solution apart than:
gapi.hangout.render('placeholder-div', {
'render': 'createhangout',
'initial_apps': [{'app_id' : '184219133185', 'start_data' : 'dQw4w9WgXcQ', 'app_type' : 'ROOM_APP' }],
'widget_size': 200
});
Deferred execution and language configuration:
window.___gcfg = {
lang: 'zh-CN',
parsetags: 'onload'
};
not much can be done.
On the manual side, holding ⌘ (CTRL on windows) while clicking on the button will open the hangout in a new tab instead.
Tested successfully on Chrome and Safari.
Unsuccessful on Firefox.
There is a plain link button available:
https://hangoutsapi.talkgadget.google.com/hangouts/_?gid=APP_ID
You can simply open this link in a new tab:
Hangout