wpf - Display authentication page on app built-in c# WebBrowser component when try to get UserCredential -
i used following code snippet retrieve usercredential
before.
usercredential credential = googlewebauthorizationbroker.authorizeasync(...);
it launch default browser , display authentication page when first authentication.
now want add webbrowser
component in wpf
application, , show authentication page on built-in webbrowser
component, can't find way implement it.
any appreciated.
this not supported google .net client library @ time. googlewebauthorizationbroker.authorizeasync opens new browser there no way auth uri embed in own webbrowser component.
there example of windows phone usercontrol here have not tested though. might help
<usercontrol x:class="google.apis.auth.oauth2.webauthenticationbrokerusercontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" mc:ignorable="d" x:classmodifier="internal" fontfamily="{staticresource phonefontfamilynormal}" fontsize="{staticresource phonefontsizenormal}" foreground="{staticresource phoneforegroundbrush}" d:designheight="480" d:designwidth="480"> <grid x:name="layoutroot" background="{staticresource phonechromebrush}" horizontalalignment="stretch" verticalalignment="stretch"> <phone:webbrowser name="browser" isscriptenabled="true" navigating="onbrowsernavigating" navigationfailed="onbrowsernavigationfailed" navigated="onbrowsernavigated" /> <progressbar name="loader" height="10" margin="10" verticalalignment="top" isindeterminate="true" /> </grid> </usercontrol>
the source code client library can found on github open source project welcome add project.
there issue request currently. googlewebauthorizationbroker in embedded browser?
Comments
Post a Comment