Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Image source http credentials

$
0
0

Hello,

I'm building an internal application and I want to use authentication on an image source.
The problem is that I need basic (or cookie login) on the UserPhotoUrl.

This is the xaml of the page, and UserPhotoUrl is a weburl where you need the authenticate before you'll get a picture back.

<ListView  ItemsSource="{Binding Staff}" ItemSelected="OnItemSelected">
            <ListView.ItemTemplate>
                <DataTemplate>
                  <ViewCell>
                    <StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal">   
                        <Image Source="{Binding UserPhotoUrl}" WidthRequest="44" HeightRequest="44" />
                        <StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Vertical">
                            <Label Text="{Binding Displayname}" YAlign="Center" LineBreakMode="TailTruncation"  />
                            <Label Text="{Binding Email}" YAlign="Center" Font="Micro"  />
                        </StackLayout>
                     </StackLayout>
                  </ViewCell>
                </DataTemplate>
              </ListView.ItemTemplate>
</ListView>

So how do I tap into the network stack that the ImageSource uses?
To for instance change headers or credentials in this case. Is this even possible?

I tried using the System.Net.CredentialCache but I cannot seem to edit this.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>