# Problem with Integration Callback URL (OAuth)

**URL:** <https://forum.mautic.org/t/problem-with-integration-callback-url-oauth/35182>\
**Category:** Development\
**Tags:** development\
**Created:** [March 5, 2025, 8:28am UTC](https://forum.mautic.org/t/problem-with-integration-callback-url-oauth/35182 "2025-03-05T08:28:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebli99](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sebli99/32/733_2.png) [@sebli99](https://forum.mautic.org/u/sebli99)\
**Post date:** [March 5, 2025, 8:28am UTC](https://forum.mautic.org/t/problem-with-integration-callback-url-oauth/35182/1 "2025-03-05T08:28:41Z")

</div>

Hi there,

I am currently trying to develop a plugin to authenticate via OAuth from another service.  
The docs and examples are quite unclear as they do not follow the same standards, and I am having problems with calling the callback route of Mautic.

As stated in the documentation, I used:

```php
public function getRedirectUri(): string
  {
    return $this->router->generate(
      'mautic_integration_public_callback',
      ['integration' => $this->getName()],
      UrlGeneratorInterface::ABSOLUTE_URL
    );
  }

```

To generate the callback URL. This works as intended. But on arriving there it should call the `AuthController.php` from the IntegrationsBundle and render the `authenticated.html.twig`.

All I am getting is the correct call to the URL (with a code appended per OAuth) and this error:  
**500** Internal Server Error - Variable “indexButton” does not exist.

I tracked it back to the `pageheader.html.twig` file where the indexButton is getting used (app/bundles/CoreBundle/Resources/views/Default/pageheader.html.twig) but I am not able to circumvent this error.

Does someone have an idea why this happens?  
Otherwise, I have to write my own route and controller for this. But I wanted to use the official tools to implement integration authentication.
