# In Case of External IDP Not Getting Firstname Lastname and Email In AddUser method of UserRegistrationProvider Interface

**URL:** <https://forum.keycloak.org/t/in-case-of-external-idp-not-getting-firstname-lastname-and-email-in-adduser-method-of-userregistrationprovider-interface/20182>\
**Category:** Miscellanaeous\
**Tags:** identity-brokering, user-federation\
**Created:** [February 10, 2023, 11:54am UTC](https://forum.keycloak.org/t/in-case-of-external-idp-not-getting-firstname-lastname-and-email-in-adduser-method-of-userregistrationprovider-interface/20182 "2023-02-10T11:54:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijender9423](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vijender9423](https://forum.keycloak.org/u/vijender9423)\
**Post date:** [February 10, 2023, 11:54am UTC](https://forum.keycloak.org/t/in-case-of-external-idp-not-getting-firstname-lastname-and-email-in-adduser-method-of-userregistrationprovider-interface/20182/1 "2023-02-10T11:54:26Z")

</div>

I am trying to login via external IDP like google .  
My use case is :

1. I want to save the user to my custom storage provider in case its a new user .
2. I want to show the user an error and do not allow login.

I have followed and read similar problems [here](http://forum.keycloak.org/t/external-id-is-removed-from-keycloakid-key-while-login-using-google-idp/9408) and [here](http://forum.keycloak.org/t/userregistrationprovider-adduser-get-firsname-lastname-and-email/7417) but my use case is bit different , I actually want to read the user info sent by idp and save the same to my custom storage and disallow login in case user is already present in DB .

How can i achieve this .  
Can anyone suggest a workaround here . I am using KC 17.0

Thanks

Regards  
Vijender
