Base solution for your next web application

Activities of "asseco"

Answer

Sure. I make it work. lets me tell what i have done

  1. Add ADFS to AD server.
  2. Change aspnetzero app to be secure(from http to https)
  3. Change Startup.Configuration. add wsfederation after app.UseAbp().
if (IsTrue("ExternalAuth.WsFederation.IsEnabled"))
            {
                app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
                app.UseWsFederationAuthentication(CreateWsFederationAuthOptions());
            }
  1. Add code to Global.asax
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate
            {
                return true;
            };
  1. Change AppSettingProvider startup configuration to use https url.
  2. Change ADFS Relying Party Trust Claim Rules
Answer

I already do that, done some adfs configuration. Now i have problem when i am trying to login with AD user. I am using _userManager.LoginAsync method to login.

var loginResult = await _userManager.LoginAsync(loginInfo.Login, tenancyName);

loginInfo.Login.LoginProvider -- http://{servername}/adfs/services/trust
loginInfo.Login.ProviderKey -- {username}@{domain}

I am getting result => AbpLoginResultType.UnknownExternalLogin. why? How can i fix that? Am i doing something wrong?

Question

I am trying to use adfs in abp, but i am facing not lot of problems. Can you provide full solution for aspnetzero and adfs?

or give me all steps what to do including adfs configuration

thanks

I have fixed it. I install postman (chrome extension) and found problem: I was using entity object in Dto, and rewrite to use it with additional dto to mapp this entity.

thanks for responce

here appservice: public PagedResultOutput<AnnouncementListDto> GetAllAnnouncements(GetAnnouncementInput input) { var totalCount = 0; var announcements = _announcementRepository .GetAll().Include(x => x.User).Include(x => x.AnnouncementDescription);

        totalCount = announcements.Count();
        announcements = announcements.OrderBy(x => x.CreationTime).PageBy(input);
        return new PagedResultOutput&lt;AnnouncementListDto&gt;(totalCount, announcements.ToList().MapTo&lt;List&lt;AnnouncementListDto&gt;>());
    }

here jtable definition: _$announcementsTable.jtable({

    title: app.localize('Announcement'),
    paging: true,
    sorting: true,
    multiSorting: true,

    actions: {
        listAction: {
            method: _announcementService.getAllAnnouncements
        }
    },

    fields: {
        id: {
            key: true,
            list: false
        },
        actions: {
            title: app.localize('Actions'),
            width: '12%',
            sorting: false,
            list: _permissions.edit || _permissions.delete,
            display: function (data) {
                var $span = $('&lt;span&gt;&lt;/span&gt;');
                                    
                if (_permissions.edit) {
                    $('&lt;button class=&quot;btn btn-default btn-xs&quot; title=&quot;&#39; + app.localize(&#39;Edit&#39;) + &#39;&quot;&gt;&lt;i class=&quot;fa fa-edit&quot;&gt;&lt;/i&gt;&lt;/button&gt;')
                        .appendTo($span)
                        .click(function () {
                            _EditAnnouncementModal.open({ id: data.record.id });
                        });
                }


                if (_permissions.delete) {
                    $('&lt;button class=&quot;btn btn-default btn-xs&quot; title=&quot;&#39; + app.localize(&#39;Delete&#39;) + &#39;&quot;&gt;&lt;i class=&quot;fa fa-trash-o&quot;&gt;&lt;/i&gt;&lt;/button&gt;')
                        .appendTo($span)
                        .click(function () {
                            _announcementService.deleteAnnouncement(data.record);
                        });
                }

                return $span;
            }
        },
        announcementDescription: {
            title: app.localize('AnnouncementDescription'),
            width: '8%',
            display: function (data) {
                var descriptions = '';

                for (var j = 0; j < data.record.announcementDescription.length; j++) {
                    if (abp.localization.isCurrentCulture(data.record.announcementDescription[j].LanguageName)) {
                        descriptions = data.record.announcementDescription[j];
                    }                            
                };
                return descriptions;
            }
        },
        publishDate: {
            title: app.localize('PublishDate'),
            width: '8%',
            display: function (data) {
                return moment(data.record.publishDate).format('L');
            }
        },
        expirationDate: {
            title: app.localize('ExpirationDate'),
            width: '8%',
            display: function (data) {
                return moment(data.record.expirationDate).format('L');
            }
        }
    }

});
Question

I am trying to use jtable and in listaction method calling appservice, but i am getting this error : "There is an action GetAnnouncements defined for api controller app/announcement but with a different HTTP Verb. Request verb is GET. It should be Post".

How can i resolve this issue?

Showing 1 to 6 of 6 entries